Skip to content

Commit d135ac1

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 d135ac1

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

.github/workflows/conda-package.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,18 +217,28 @@ 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
223+
- name: List directory of checkout
224+
run: ls -l dpctl
220225
- name: Create test temp dir
221226
# create temporary empty folder to runs tests from
222227
# https://github.com/pytest-dev/pytest/issues/11904
223228
run: mkdir -p ${GITHUB_WORKSPACE}/test_tmp
229+
- name: Create symbolic link to checked-out tests folder
230+
run: ln -s ${GITHUB_WORKSPACE}/dpctl/dpctl/tests/ ${GITHUB_WORKSPACE}/test_tmp/dpctl_tests
231+
- name: List directory of temp_tmp
232+
working-directory: ${{ github.workspace }}/test_tmp
233+
run: ls -l
224234
- name: Run tests
225235
working-directory: ${{ github.workspace }}/test_tmp
226236
env:
227237
SYCL_CACHE_PERSISTENT: 1
228238
run: |
229239
. $CONDA/etc/profile.d/conda.sh
230240
conda activate ${{ env.TEST_ENV_NAME }}
231-
python -m pytest -v --pyargs $MODULE_NAME --skip-known-top-k-failures-on-cpu
241+
python -m pytest -v --skip-known-top-k-failures-on-cpu dpctl_tests
232242
233243
test_windows:
234244
needs: build_windows
@@ -382,24 +392,37 @@ jobs:
382392
run: >-
383393
conda activate ${{ env.TEST_ENV_NAME }} && python -m dpctl -f
384394
395+
- uses: actions/checkout@v4.2.2
396+
with:
397+
fetch-depth: 0
398+
385399
- name: Create empty temporary directory to run tests from
386400
shell: cmd /C CALL {0}
387401
# create temporary empty folder to runs tests from
388402
# https://github.com/pytest-dev/pytest/issues/11904
389403
run: >-
390404
mkdir "${{ env.workdir }}\test_tmp"
391405
406+
- name: Copy tests from checkout
407+
shell: cmd /C CALL {0}
408+
run: >-
409+
xcopy /S "{{ env.workdir }}\dpctl\dpctl\tests" "${{ env.workdir }}\test_tmp"
410+
392411
- name: List content of workdir folder
393412
shell: cmd /C CALL {0}
394413
run: dir "${{ env.workdir }}"
395414

415+
- name: List content of test_tmp folder
416+
shell: cmd /C CALL {0}
417+
run: dir "${{ env.workdir }}\test_tmp"
418+
396419
- name: Run tests
397420
shell: cmd /C CALL {0}
398421
env:
399422
SYCL_CACHE_PERSISTENT: 1
400423
working-directory: ${{ env.workdir }}\test_tmp
401424
run: >-
402-
conda activate ${{ env.TEST_ENV_NAME }} && python -m pytest -v -s --pyargs ${{ env.MODULE_NAME }} --skip-known-top-k-failures-on-cpu
425+
conda activate ${{ env.TEST_ENV_NAME }} && python -m pytest -v -s --skip-known-top-k-failures-on-cpu --pyargs ${{ env.MODULE_NAME }}
403426
404427
upload_linux:
405428
needs: test_linux

0 commit comments

Comments
 (0)