Skip to content

Commit 3a834b1

Browse files
committed
Fix running benchmarks in CI.
1 parent 8366647 commit 3a834b1

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.github/workflows/test_and_deploy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ jobs:
3939
steps:
4040
# Run tests
4141
- uses: neuroinformatics-unit/actions/test@v2
42+
env:
43+
# To not skip test_benchmarks
44+
RUN_BENCHMARKS: true
4245
with:
4346
python-version: ${{ matrix.python-version }}
4447
secret-codecov-token: ${{ secrets.CODECOV_TOKEN }}

tests/tests/test_benchmarks.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@
55

66
import fancylog
77

8+
# Set an environment variable to run benchmarks. This
9+
# is used to selectively run benchmarks through GitHub CI.
10+
RUN_BENCHMARKS = os.getenv("RUN_BENCHMARKS", "").lower() == "true"
811

9-
@pytest.mark.skipif(not os.getenv("CI"), reason="Benchmark skipped outside CI")
12+
13+
@pytest.mark.skipif(not RUN_BENCHMARKS, reason="`RUN_BENCHMARKS` was false`")
1014
def test_benchmark(tmp_path, capsys):
1115
"""
1216
A very rough benchmark to check for large regressions

0 commit comments

Comments
 (0)