Skip to content

Commit

Permalink
Change to conda-package.yaml
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
oleksandr-pavlyk committed Dec 30, 2024
1 parent 9b33343 commit d135ac1
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions .github/workflows/conda-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,18 +217,28 @@ jobs:
. $CONDA/etc/profile.d/conda.sh
conda activate ${{ env.TEST_ENV_NAME }}
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
- uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
- name: List directory of checkout
run: ls -l dpctl
- name: Create test temp dir
# create temporary empty folder to runs tests from
# https://github.com/pytest-dev/pytest/issues/11904
run: mkdir -p ${GITHUB_WORKSPACE}/test_tmp
- name: Create symbolic link to checked-out tests folder
run: ln -s ${GITHUB_WORKSPACE}/dpctl/dpctl/tests/ ${GITHUB_WORKSPACE}/test_tmp/dpctl_tests
- name: List directory of temp_tmp
working-directory: ${{ github.workspace }}/test_tmp
run: ls -l
- name: Run tests
working-directory: ${{ github.workspace }}/test_tmp
env:
SYCL_CACHE_PERSISTENT: 1
run: |
. $CONDA/etc/profile.d/conda.sh
conda activate ${{ env.TEST_ENV_NAME }}
python -m pytest -v --pyargs $MODULE_NAME --skip-known-top-k-failures-on-cpu
python -m pytest -v --skip-known-top-k-failures-on-cpu dpctl_tests
test_windows:
needs: build_windows
Expand Down Expand Up @@ -382,24 +392,37 @@ jobs:
run: >-
conda activate ${{ env.TEST_ENV_NAME }} && python -m dpctl -f
- uses: actions/checkout@v4.2.2
with:
fetch-depth: 0

- name: Create empty temporary directory to run tests from
shell: cmd /C CALL {0}
# create temporary empty folder to runs tests from
# https://github.com/pytest-dev/pytest/issues/11904
run: >-
mkdir "${{ env.workdir }}\test_tmp"
- name: Copy tests from checkout
shell: cmd /C CALL {0}
run: >-
xcopy /S "{{ env.workdir }}\dpctl\dpctl\tests" "${{ env.workdir }}\test_tmp"
- name: List content of workdir folder
shell: cmd /C CALL {0}
run: dir "${{ env.workdir }}"

- name: List content of test_tmp folder
shell: cmd /C CALL {0}
run: dir "${{ env.workdir }}\test_tmp"

- name: Run tests
shell: cmd /C CALL {0}
env:
SYCL_CACHE_PERSISTENT: 1
working-directory: ${{ env.workdir }}\test_tmp
run: >-
conda activate ${{ env.TEST_ENV_NAME }} && python -m pytest -v -s --pyargs ${{ env.MODULE_NAME }} --skip-known-top-k-failures-on-cpu
conda activate ${{ env.TEST_ENV_NAME }} && python -m pytest -v -s --skip-known-top-k-failures-on-cpu --pyargs ${{ env.MODULE_NAME }}
upload_linux:
needs: test_linux
Expand Down

0 comments on commit d135ac1

Please sign in to comment.