Skip to content

Commit ed7bba2

Browse files
authored
Add a retry for running tests in nightly and oneMKL interface test actions (#2195)
* Add a retry for running tests in nightly action * nick-fields/retry action now passes shell arguments * Add rerun to actions testing oneMKL interfaces
1 parent cd23361 commit ed7bba2

File tree

3 files changed

+77
-7
lines changed

3 files changed

+77
-7
lines changed

.github/workflows/check-mkl-interfaces.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ permissions: read-all
1111
env:
1212
CHANNELS: '-c dppy/label/dev -c https://software.repos.intel.com/python/conda/ -c conda-forge --override-channels'
1313
TEST_ENV_NAME: 'test_onemkl_interfaces'
14+
RERUN_TESTS_ON_FAILURE: 'true'
15+
RUN_TESTS_MAX_ATTEMPTS: 2
1416
BUILD_DEP_PKGS: >-
1517
mkl-devel-dpcpp
1618
tbb-devel
@@ -95,11 +97,29 @@ jobs:
9597
mamba install pytest ${{ env.CHANNELS }}
9698
9799
- name: Run tests
100+
if: env.RERUN_TESTS_ON_FAILURE != 'true'
98101
run: |
99102
python -m pytest -ra --pyargs dpnp.tests
100103
env:
101104
SYCL_CACHE_PERSISTENT: 1
102105

106+
- name: ReRun tests on Linux
107+
if: env.RERUN_TESTS_ON_FAILURE == 'true'
108+
id: run_tests
109+
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
110+
with:
111+
timeout_minutes: 10
112+
max_attempts: ${{ env.RUN_TESTS_MAX_ATTEMPTS }}
113+
retry_on: any
114+
command: |
115+
. $CONDA/etc/profile.d/conda.sh
116+
. $CONDA/etc/profile.d/mamba.sh
117+
mamba activate ${{ env.TEST_ENV_NAME }}
118+
119+
python -m pytest -ra --pyargs dpnp.tests
120+
env:
121+
SYCL_CACHE_PERSISTENT: 1
122+
103123
test_by_branch:
104124
name: Run on ['${{ matrix.os }}', python='${{ matrix.python }}'] with oneMKL develop branch
105125

@@ -185,7 +205,25 @@ jobs:
185205
mamba install pytest ${{ env.CHANNELS }}
186206
187207
- name: Run tests
208+
if: env.RERUN_TESTS_ON_FAILURE != 'true'
188209
run: |
189210
python -m pytest -ra --pyargs dpnp.tests
190211
env:
191212
SYCL_CACHE_PERSISTENT: 1
213+
214+
- name: ReRun tests on Linux
215+
if: env.RERUN_TESTS_ON_FAILURE == 'true'
216+
id: run_tests
217+
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
218+
with:
219+
timeout_minutes: 10
220+
max_attempts: ${{ env.RUN_TESTS_MAX_ATTEMPTS }}
221+
retry_on: any
222+
command: |
223+
. $CONDA/etc/profile.d/conda.sh
224+
. $CONDA/etc/profile.d/mamba.sh
225+
mamba activate ${{ env.TEST_ENV_NAME }}
226+
227+
python -m pytest -ra --pyargs dpnp.tests
228+
env:
229+
SYCL_CACHE_PERSISTENT: 1

.github/workflows/conda-package.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,15 @@ jobs:
182182
id: run_tests_linux
183183
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
184184
with:
185-
shell: bash
186185
timeout_minutes: 10
187186
max_attempts: ${{ env.RUN_TESTS_MAX_ATTEMPTS }}
188187
retry_on: any
189188
command: |
190189
. $CONDA/etc/profile.d/conda.sh
191-
conda activate ${{ env.TEST_ENV_NAME }}
192-
pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
190+
. $CONDA/etc/profile.d/mamba.sh
191+
mamba activate ${{ env.TEST_ENV_NAME }}
192+
193+
python -m pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
193194
194195
test_windows:
195196
name: Test ['windows-2019', python='${{ matrix.python }}']
@@ -317,13 +318,11 @@ jobs:
317318
id: run_tests_win
318319
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
319320
with:
320-
shell: cmd
321321
timeout_minutes: 15
322322
max_attempts: ${{ env.RUN_TESTS_MAX_ATTEMPTS }}
323323
retry_on: any
324-
command: >-
325-
mamba activate ${{ env.TEST_ENV_NAME }}
326-
& pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
324+
command: |
325+
python -m pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
327326
328327
upload:
329328
name: Upload ['${{ matrix.os }}', python='${{ matrix.python }}']

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

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ env:
1515
PACKAGE_NAME: dpnp
1616
CHANNELS: '-c dppy/label/dev -c https://software.repos.intel.com/python/conda/ -c conda-forge --override-channels'
1717
TEST_ENV_NAME: test
18+
RERUN_TESTS_ON_FAILURE: 'true'
19+
RUN_TESTS_MAX_ATTEMPTS: 2
1820

1921
jobs:
2022
test:
@@ -82,7 +84,38 @@ jobs:
8284
python -c "import dpnp; print(dpnp.__version__)"
8385
8486
- name: Run tests
87+
if: env.RERUN_TESTS_ON_FAILURE != 'true'
8588
run: |
8689
python -m pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
8790
env:
8891
SYCL_CACHE_PERSISTENT: 1
92+
93+
- name: ReRun tests on Linux
94+
if: env.RERUN_TESTS_ON_FAILURE == 'true' && matrix.runner != 'windows-2019'
95+
id: run_tests_linux
96+
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
97+
with:
98+
timeout_minutes: 10
99+
max_attempts: ${{ env.RUN_TESTS_MAX_ATTEMPTS }}
100+
retry_on: any
101+
command: |
102+
. $CONDA/etc/profile.d/conda.sh
103+
. $CONDA/etc/profile.d/mamba.sh
104+
mamba activate ${{ env.TEST_ENV_NAME }}
105+
106+
python -m pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
107+
env:
108+
SYCL_CACHE_PERSISTENT: 1
109+
110+
- name: ReRun tests on Windows
111+
if: env.RERUN_TESTS_ON_FAILURE == 'true' && matrix.runner == 'windows-2019'
112+
id: run_tests_win
113+
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # v3.0.0
114+
with:
115+
timeout_minutes: 15
116+
max_attempts: ${{ env.RUN_TESTS_MAX_ATTEMPTS }}
117+
retry_on: any
118+
command: |
119+
python -m pytest -ra --pyargs ${{ env.PACKAGE_NAME }}.tests
120+
env:
121+
SYCL_CACHE_PERSISTENT: 1

0 commit comments

Comments
 (0)