From 2855ff757f98752ddda0e1422f47143e981a31a0 Mon Sep 17 00:00:00 2001 From: jnsbck-uni Date: Thu, 21 Nov 2024 20:03:09 +0100 Subject: [PATCH] fix: use marker and update tests to exclude regressions --- .github/workflows/regression_tests.yml | 2 +- .github/workflows/tests.yml | 2 +- .github/workflows/update_regression_baseline.yml | 2 +- tests/conftest.py | 2 +- tests/test_regression.py | 14 +++++++------- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/regression_tests.yml b/.github/workflows/regression_tests.yml index df7cdeb2..9a08ca77 100644 --- a/.github/workflows/regression_tests.yml +++ b/.github/workflows/regression_tests.yml @@ -36,7 +36,7 @@ jobs: else echo "No regression test results found in main branch" fi - pytest tests/test_regression.py + pytest -m regression git checkout # - name: Comment PR diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ff5ef5bc..1750f290 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,4 +39,4 @@ jobs: - name: Test with pytest run: | pip install pytest pytest-cov - pytest tests/ -m "not runtime" --cov=jaxley --cov-report=xml + pytest tests/ -m "not regression" --cov=jaxley --cov-report=xml diff --git a/.github/workflows/update_regression_baseline.yml b/.github/workflows/update_regression_baseline.yml index 91b2ad62..427e9213 100644 --- a/.github/workflows/update_regression_baseline.yml +++ b/.github/workflows/update_regression_baseline.yml @@ -33,7 +33,7 @@ jobs: run: | git config --global user.name 'GitHub Action' git config --global user.email 'action@github.com' - NEW_BASELINE=1 pytest tests/test_regression.py + NEW_BASELINE=1 pytest -m regression - name: Commit and push if baseline changed if: github.event.pull_request.base.ref == 'main' diff --git a/tests/conftest.py b/tests/conftest.py index 354594d7..15f01295 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -232,7 +232,7 @@ def print_regression_report(): print("\n\n\nRegression Test Report\n----------------------\n") if not baselines: print( - "No baselines found. Run `git checkout main;UPDATE_BASELINE=1 pytest tests/test_regression.py; git checkout -`" + "No baselines found. Run `git checkout main;UPDATE_BASELINE=1 pytest -m regression; git checkout -`" ) print(generate_regression_report(baselines, results)) diff --git a/tests/test_regression.py b/tests/test_regression.py index 511c68c4..932649c3 100644 --- a/tests/test_regression.py +++ b/tests/test_regression.py @@ -186,13 +186,13 @@ def build_net(num_cells, artificial=True, connect=True, connection_prob=0.0): ( # Test a single SWC cell with both solvers. pytest.param(1, False, False, 0.0, "jaxley.stone"), - # pytest.param(1, False, False, 0.0, "jax.sparse"), - # # Test a network of SWC cells with both solvers. - # pytest.param(10, False, True, 0.1, "jaxley.stone"), - # pytest.param(10, False, True, 0.1, "jax.sparse"), - # # Test a larger network of smaller neurons with both solvers. - # pytest.param(1000, True, True, 0.001, "jaxley.stone"), - # pytest.param(1000, True, True, 0.001, "jax.sparse"), + pytest.param(1, False, False, 0.0, "jax.sparse"), + # Test a network of SWC cells with both solvers. + pytest.param(10, False, True, 0.1, "jaxley.stone"), + pytest.param(10, False, True, 0.1, "jax.sparse"), + # Test a larger network of smaller neurons with both solvers. + pytest.param(1000, True, True, 0.001, "jaxley.stone"), + pytest.param(1000, True, True, 0.001, "jax.sparse"), ), ) @compare_to_baseline(baseline_iters=3)