Skip to content

Commit 967aa6f

Browse files
Change to conda-package.yaml
In test_linux, test_windows, copy dpctl/tests folder into test_tmp to enable pytest conftest.py discovery without needing to parse command line arguments (as the use --pyargs requires)
1 parent 9b33343 commit 967aa6f

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

.github/workflows/conda-package.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,18 +217,23 @@ jobs:
217217
. $CONDA/etc/profile.d/conda.sh
218218
conda activate ${{ env.TEST_ENV_NAME }}
219219
gdb --batch -ex r -ex 'info sharedlibrary' -ex 'set print elements 1000' -ex bt --args ${CONDA_PREFIX}/bin/python -m pytest -q -ra --disable-warnings --pyargs dpctl.tests.elementwise.test_trigonometric::test_trig_order -vv || true
220+
- uses: actions/checkout@v4.2.2
221+
with:
222+
fetch-depth: 0
220223
- name: Create test temp dir
221224
# create temporary empty folder to runs tests from
222225
# https://github.com/pytest-dev/pytest/issues/11904
223226
run: mkdir -p ${GITHUB_WORKSPACE}/test_tmp
227+
- name: Create symbolic link to checked-out tests folder
228+
run: ln -s ${GITHUB_WORKSPACE}/dpctl/dpctl/tests/ ${GITHUB_WORKSPACE}/test_tmp/dpctl_tests
224229
- name: Run tests
225230
working-directory: ${{ github.workspace }}/test_tmp
226231
env:
227232
SYCL_CACHE_PERSISTENT: 1
228233
run: |
229234
. $CONDA/etc/profile.d/conda.sh
230235
conda activate ${{ env.TEST_ENV_NAME }}
231-
python -m pytest -v --pyargs $MODULE_NAME --skip-known-top-k-failures-on-cpu
236+
python -m pytest -v --skip-known-top-k-failures-on-cpu dpctl_tests
232237
233238
test_windows:
234239
needs: build_windows
@@ -380,7 +385,11 @@ jobs:
380385
- name: Smoke test, step 2
381386
shell: cmd /C CALL {0}
382387
run: >-
383-
conda activate ${{ env.TEST_ENV_NAME }} && python -m dpctl -f
388+
conda activate ${{ env.TEST_ENV_NAME }} && python -m dpctl -
389+
390+
- uses: actions/checkout@v4.2.2
391+
with:
392+
fetch-depth: 0
384393

385394
- name: Create empty temporary directory to run tests from
386395
shell: cmd /C CALL {0}
@@ -389,17 +398,26 @@ jobs:
389398
run: >-
390399
mkdir "${{ env.workdir }}\test_tmp"
391400
401+
- name: Copy tests from checkout
402+
shell: cmd /C CALL {0}
403+
run: >-
404+
xcopy /S "{{ env.workdir }}\dpctl\dpctl\tests" "${{ env.workdir }}\test_tmp"
405+
392406
- name: List content of workdir folder
393407
shell: cmd /C CALL {0}
394408
run: dir "${{ env.workdir }}"
395409

410+
- name: List content of test_tmp folder
411+
shell: cmd /C CALL {0}
412+
run: dir "${{ env.workdir }}\test_tmp"
413+
396414
- name: Run tests
397415
shell: cmd /C CALL {0}
398416
env:
399417
SYCL_CACHE_PERSISTENT: 1
400418
working-directory: ${{ env.workdir }}\test_tmp
401419
run: >-
402-
conda activate ${{ env.TEST_ENV_NAME }} && python -m pytest -v -s --pyargs ${{ env.MODULE_NAME }} --skip-known-top-k-failures-on-cpu
420+
conda activate ${{ env.TEST_ENV_NAME }} && python -m pytest -v -s --skip-known-top-k-failures-on-cpu --pyargs ${{ env.MODULE_NAME }}
403421
404422
upload_linux:
405423
needs: test_linux

0 commit comments

Comments
 (0)