Skip to content

Commit afc3360

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 afc3360

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

.github/workflows/conda-package.yml

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,18 +217,34 @@ 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: Location of working directory
224+
working-directory: ${{ github.workspace }}
225+
run: pwd
226+
- name: List directory of checkout
227+
working-directory: ${{ github.workspace }}
228+
run: ls -l dpctl
220229
- name: Create test temp dir
221230
# create temporary empty folder to runs tests from
222231
# https://github.com/pytest-dev/pytest/issues/11904
223232
run: mkdir -p ${GITHUB_WORKSPACE}/test_tmp
233+
- name: Create symbolic link to checked-out tests folder
234+
run: ln -s ${GITHUB_WORKSPACE}/dpctl/tests/ ${GITHUB_WORKSPACE}/test_tmp/dpctl_tests
235+
- name: List content of symbolic directory
236+
run: ls -l ${GITHUB_WORKSPACE}/test_tmp/dpctl_tests
237+
- name: List directory of temp_tmp
238+
working-directory: ${{ github.workspace }}/test_tmp
239+
run: ls -l
224240
- name: Run tests
225241
working-directory: ${{ github.workspace }}/test_tmp
226242
env:
227243
SYCL_CACHE_PERSISTENT: 1
228244
run: |
229245
. $CONDA/etc/profile.d/conda.sh
230246
conda activate ${{ env.TEST_ENV_NAME }}
231-
python -m pytest -v --pyargs $MODULE_NAME --skip-known-top-k-failures-on-cpu
247+
python -m pytest -v --skip-known-top-k-failures-on-cpu dpctl_tests
232248
233249
test_windows:
234250
needs: build_windows
@@ -382,24 +398,37 @@ jobs:
382398
run: >-
383399
conda activate ${{ env.TEST_ENV_NAME }} && python -m dpctl -f
384400
401+
- uses: actions/checkout@v4.2.2
402+
with:
403+
fetch-depth: 0
404+
385405
- name: Create empty temporary directory to run tests from
386406
shell: cmd /C CALL {0}
387407
# create temporary empty folder to runs tests from
388408
# https://github.com/pytest-dev/pytest/issues/11904
389409
run: >-
390-
mkdir "${{ env.workdir }}\test_tmp"
410+
mkdir "${{ env.workdir }}\test_tmp" && mkdir "${{ env.workdir }}\test_tmp\dpctl_tests"
411+
412+
- name: Copy tests from checkout
413+
shell: cmd /C CALL {0}
414+
run: >-
415+
xcopy /S /E "${{ env.workdir }}\dpctl\tests" "${{ env.workdir }}\test_tmp\dpctl_tests"
391416
392417
- name: List content of workdir folder
393418
shell: cmd /C CALL {0}
394419
run: dir "${{ env.workdir }}"
395420

421+
- name: List content of test_tmp folder
422+
shell: cmd /C CALL {0}
423+
run: dir "${{ env.workdir }}\test_tmp"
424+
396425
- name: Run tests
397426
shell: cmd /C CALL {0}
398427
env:
399428
SYCL_CACHE_PERSISTENT: 1
400429
working-directory: ${{ env.workdir }}\test_tmp
401430
run: >-
402-
conda activate ${{ env.TEST_ENV_NAME }} && python -m pytest -v -s --pyargs ${{ env.MODULE_NAME }} --skip-known-top-k-failures-on-cpu
431+
conda activate ${{ env.TEST_ENV_NAME }} && python -m pytest -v -s --skip-known-top-k-failures-on-cpu dpctl_tests
403432
404433
upload_linux:
405434
needs: test_linux

0 commit comments

Comments
 (0)