Skip to content

Commit 103bcde

Browse files
committed
Continue past collection errors in serial runs a --lf retry follows
A collection error interrupts a serial pytest run before any test runs and records only the broken module, so a `--lf` retry ran just that module and could pass without the rest of the suite. With `--continue-on-collection-errors` the first attempt runs the other tests, and the retry covers their failures too. The `-n auto` runs don't need it, since xdist already runs the remaining tests after a collection error.
1 parent b3144ad commit 103bcde

4 files changed

Lines changed: 14 additions & 10 deletions

File tree

‎.github/workflows/check-onemath.yaml‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ env:
2828
test-env-name: 'test_onemath'
2929
rerun-tests-on-failure: 'true'
3030
# A retry reruns only the failed tests (--lf), or all of them after a timeout kill
31+
# Serial runs also need --continue-on-collection-errors, or a collection error skips all other tests
3132
rerun-tests-max-attempts: 2
3233
rerun-tests-timeout: 30
3334
rerun-tensor-tests-timeout: 10
@@ -189,7 +190,7 @@ jobs:
189190
. $CONDA/etc/profile.d/mamba.sh
190191
mamba activate ${{ env.test-env-name }}
191192
192-
python -m pytest -ra --lf --pyargs dpnp.tests
193+
python -m pytest -ra --lf --continue-on-collection-errors --pyargs dpnp.tests
193194
env:
194195
SKIP_TENSOR_TESTS: 1
195196
SYCL_CACHE_PERSISTENT: 1
@@ -207,7 +208,7 @@ jobs:
207208
. $CONDA/etc/profile.d/mamba.sh
208209
mamba activate ${{ env.test-env-name }}
209210
210-
python -m pytest -ra --lf --pyargs dpnp.tests.tensor
211+
python -m pytest -ra --lf --continue-on-collection-errors --pyargs dpnp.tests.tensor
211212
env:
212213
SYCL_CACHE_PERSISTENT: 1
213214

@@ -325,7 +326,7 @@ jobs:
325326
. $CONDA/etc/profile.d/mamba.sh
326327
mamba activate ${{ env.test-env-name }}
327328
328-
python -m pytest -ra --lf --pyargs dpnp.tests
329+
python -m pytest -ra --lf --continue-on-collection-errors --pyargs dpnp.tests
329330
env:
330331
SKIP_TENSOR_TESTS: 1
331332
SYCL_CACHE_PERSISTENT: 1
@@ -343,6 +344,6 @@ jobs:
343344
. $CONDA/etc/profile.d/mamba.sh
344345
mamba activate ${{ env.test-env-name }}
345346
346-
python -m pytest -ra --lf --pyargs dpnp.tests.tensor
347+
python -m pytest -ra --lf --continue-on-collection-errors --pyargs dpnp.tests.tensor
347348
env:
348349
SYCL_CACHE_PERSISTENT: 1

‎.github/workflows/conda-build-test.yml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ env:
3434
python-ver-test-all-dtypes: '3.14'
3535
test-env-name: 'test'
3636
# A retry reruns only the failed tests (--lf), or all of them after a timeout kill
37+
# Serial runs also need --continue-on-collection-errors, or a collection error skips all other tests
3738
rerun-tests-max-attempts: 2
3839
rerun-tests-timeout: 45
3940
rerun-tensor-tests-timeout: 15
@@ -283,7 +284,7 @@ jobs:
283284
284285
if [[ "${{ env.python-label }}" == "${{ env.python-ver-test-all-dtypes }}" ]]; then
285286
export DPNP_TEST_ALL_INT_TYPES=1
286-
python -m pytest -ra --lf --pyargs ${{ env.module-name }}.tests
287+
python -m pytest -ra --lf --continue-on-collection-errors --pyargs ${{ env.module-name }}.tests
287288
else
288289
python -m pytest -n auto -ra --lf --pyargs ${{ env.module-name }}.tests
289290
fi

‎.github/workflows/conda-package.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ env:
2828
test-env-name: 'test'
2929
rerun-tests-on-failure: 'true'
3030
# A retry reruns only the failed tests (--lf), or all of them after a timeout kill
31+
# Serial runs also need --continue-on-collection-errors, or a collection error skips all other tests
3132
rerun-tests-max-attempts: 2
3233
rerun-tests-timeout: 45
3334
rerun-tensor-tests-timeout: 15
@@ -296,7 +297,7 @@ jobs:
296297
297298
if [[ "${{ env.python-label }}" == "${{ env.python-ver-test-all-dtypes }}" ]]; then
298299
export DPNP_TEST_ALL_INT_TYPES=1
299-
python -m pytest -ra --lf --pyargs ${{ env.package-name }}.tests
300+
python -m pytest -ra --lf --continue-on-collection-errors --pyargs ${{ env.package-name }}.tests
300301
else
301302
python -m pytest -n auto -ra --lf --pyargs ${{ env.package-name }}.tests
302303
fi
@@ -604,7 +605,7 @@ jobs:
604605
$env:SKIP_TENSOR_TESTS=1
605606
if ( "${{ env.python-label }}" -eq "${{ env.python-ver-test-all-dtypes }}" ) {
606607
$env:DPNP_TEST_ALL_INT_TYPES=1
607-
python -m pytest -ra --lf --pyargs ${{ env.package-name }}.tests
608+
python -m pytest -ra --lf --continue-on-collection-errors --pyargs ${{ env.package-name }}.tests
608609
} else {
609610
python -m pytest -n auto -ra --lf --pyargs ${{ env.package-name }}.tests
610611
}

‎.github/workflows/cron-run-tests.yaml‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ env:
1717
test-env-name: test
1818
test-packages: 'pytest scipy'
1919
# A retry reruns only the failed tests (--lf), or all of them after a timeout kill
20+
# Serial runs also need --continue-on-collection-errors, or a collection error skips all other tests
2021
rerun-tests-max-attempts: 2
2122
rerun-tests-timeout: 20
2223

@@ -139,7 +140,7 @@ jobs:
139140
id: run_tests
140141
continue-on-error: true
141142
run: |
142-
python -m pytest -ra --pyargs ${{ env.package-name }}.tests
143+
python -m pytest -ra --continue-on-collection-errors --pyargs ${{ env.package-name }}.tests
143144
env:
144145
SYCL_CACHE_PERSISTENT: 1
145146

@@ -156,7 +157,7 @@ jobs:
156157
. $CONDA/etc/profile.d/mamba.sh
157158
mamba activate ${{ env.test-env-name }}
158159
159-
python -m pytest -ra --lf --pyargs ${{ env.package-name }}.tests
160+
python -m pytest -ra --lf --continue-on-collection-errors --pyargs ${{ env.package-name }}.tests
160161
env:
161162
SYCL_CACHE_PERSISTENT: 1
162163

@@ -169,6 +170,6 @@ jobs:
169170
max_attempts: ${{ env.rerun-tests-max-attempts }}
170171
retry_on: any
171172
command: |
172-
python -m pytest -ra --lf --pyargs ${{ env.package-name }}.tests
173+
python -m pytest -ra --lf --continue-on-collection-errors --pyargs ${{ env.package-name }}.tests
173174
env:
174175
SYCL_CACHE_PERSISTENT: 1

0 commit comments

Comments
 (0)