Skip to content

Commit f08a40f

Browse files
authored
Split test suite by folder (#439)
1 parent 73e5e60 commit f08a40f

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

.github/workflows/test.yml

+23-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ jobs:
2121
os: [ubuntu-latest]
2222
python-version: ["3.10"]
2323
test-subset:
24-
- tests
24+
- tests/model
25+
- tests/statespace/test_statespace.py
26+
- tests/statespace/test_kalman_filter.py
27+
- tests/statespace --ignore tests/statespace/test_statespace.py --ignore tests/statespace/test_kalman_filter.py
28+
- tests/distributions
29+
- tests --ignore tests/model --ignore tests/statespace --ignore tests/distributions
2530
fail-fast: false
2631
runs-on: ${{ matrix.os }}
2732
env:
@@ -46,7 +51,7 @@ jobs:
4651
python --version
4752
- name: Run tests
4853
run: |
49-
python -m pytest -vv --cov=pymc_extras --cov-append --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET
54+
python -m pytest --color=yes -vv --cov=pymc_extras --cov-append --cov-report=xml --cov-report term --durations=50 $TEST_SUBSET
5055
- name: Upload coverage to Codecov
5156
uses: codecov/codecov-action@v2
5257
with:
@@ -59,7 +64,12 @@ jobs:
5964
os: [windows-latest]
6065
python-version: ["3.12"]
6166
test-subset:
62-
- tests
67+
- tests/model
68+
- tests/statespace/test_statespace.py
69+
- tests/statespace/test_kalman_filter.py
70+
- tests/statespace --ignore tests/statespace/test_statespace.py --ignore tests/statespace/test_kalman_filter.py
71+
- tests/distributions
72+
- tests --ignore tests/model --ignore tests/statespace --ignore tests/distributions
6373
fail-fast: false
6474
runs-on: ${{ matrix.os }}
6575
env:
@@ -87,10 +97,19 @@ jobs:
8797
# This job uses a cmd shell, therefore the environment variable syntax is different!
8898
# The ">-" in the next line replaces newlines with spaces (see https://stackoverflow.com/a/66809682).
8999
run: >-
90-
python -m pytest -vv --cov=pymc_extras --cov-append --cov-report=xml --cov-report term --durations=50 %TEST_SUBSET%
100+
python -m pytest --color=yes -vv --cov=pymc_extras --cov-append --cov-report=xml --cov-report term --durations=50 %TEST_SUBSET%
91101
- name: Upload coverage to Codecov
92102
uses: codecov/codecov-action@v2
93103
with:
94104
env_vars: TEST_SUBSET
95105
name: ${{ matrix.os }}
96106
fail_ci_if_error: false
107+
108+
all_tests:
109+
if: ${{ always() }}
110+
runs-on: ubuntu-latest
111+
needs: [ ubuntu, windows ]
112+
steps:
113+
- name: Check all tests pass
114+
if: ${{ needs.ubuntu.result != 'success' || needs.windows.result != 'success' }}
115+
run: exit 1

0 commit comments

Comments
 (0)