Skip to content

Commit cac52d8

Browse files
Run tests from test_tmp folder
1 parent 2cdca1e commit cac52d8

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

.github/workflows/conda-package.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -259,16 +259,16 @@ jobs:
259259
python -c "import dpnp, dpctl; dpctl.lsplatform()"
260260
python -c "import dpnp; print(dpnp.__version__)"
261261
262-
- name: Set tests_path for installed package
263-
run: |
264-
tests_path=$(python -c "import site; import os; print(os.path.join(site.getsitepackages()[0], 'dpnp', 'tests'))")
265-
echo "tests_path=$tests_path" >> $GITHUB_ENV
262+
- name: Create test temp dir
263+
# create temporary empty folder to runs tests from
264+
# https://github.com/pytest-dev/pytest/issues/11904
265+
run: mkdir -p ${GITHUB_WORKSPACE}/test_tmp
266266

267267
- name: Run tests
268268
if: env.RERUN_TESTS_ON_FAILURE != 'true'
269269
run: |
270270
python -m pytest -q -ra --disable-warnings -vv ${{ env.TEST_SCOPE }}
271-
working-directory: ${{ env.tests_path }}
271+
working-directory: ${{ github.workspace }}/test_tmp
272272

273273
- name: Run tests
274274
if: env.RERUN_TESTS_ON_FAILURE == 'true'
@@ -282,7 +282,7 @@ jobs:
282282
command: |
283283
. $CONDA/etc/profile.d/conda.sh
284284
conda activate ${{ env.TEST_ENV_NAME }}
285-
cd ${{ env.tests_path }}
285+
cd ${{ github.workspace }}/test_tmp
286286
python -m pytest -q -ra --disable-warnings -vv ${{ env.TEST_SCOPE }}
287287
288288
test_windows:
@@ -308,6 +308,7 @@ jobs:
308308
pkg-path-in-channel: '${{ github.workspace }}\channel\win-64\'
309309
extracted-pkg-path: '${{ github.workspace }}\pkg'
310310
ver-json-path: '${{ github.workspace }}\version.json'
311+
workdir: '${{ github.workspace }}'
311312

312313
steps:
313314
- name: Download artifact
@@ -418,16 +419,17 @@ jobs:
418419
python -c "import dpnp, dpctl; dpctl.lsplatform()"
419420
python -c "import dpnp; print(dpnp.__version__)"
420421
421-
- name: Set tests_path for installed package
422+
- name: Create empty temporary directory to run tests from
423+
# create temporary empty folder to runs tests from
424+
# https://github.com/pytest-dev/pytest/issues/11904
422425
run: |
423-
FOR /F "delims=" %%i IN ('python -c "import sysconfig, os; print(os.path.join(sysconfig.get_paths()[\"purelib\"], 'dpnp', 'tests'))"') DO SET tests_path=%%i
424-
echo tests_path=%tests_path%>>%GITHUB_ENV%
426+
mkdir "${{ env.workdir }}\test_tmp"
425427
426428
- name: Run tests
427429
if: env.RERUN_TESTS_ON_FAILURE != 'true'
428430
run: |
429431
python -m pytest -q -ra --disable-warnings -vv ${{ env.TEST_SCOPE }}
430-
working-directory: ${{ env.tests_path }}
432+
working-directory: ${{ env.workdir }}\test_tmp
431433

432434
- name: Run tests
433435
if: env.RERUN_TESTS_ON_FAILURE == 'true'
@@ -440,8 +442,7 @@ jobs:
440442
retry_on: any
441443
command: >-
442444
mamba activate ${{ env.TEST_ENV_NAME }}
443-
& C:
444-
& cd ${{ env.tests_path }}
445+
& cd ${{ env.workdir }}\test_tmp
445446
& python -m pytest -q -ra --disable-warnings -vv ${{ env.TEST_SCOPE }}
446447
447448
upload:

0 commit comments

Comments
 (0)