Skip to content

Commit 25fb39b

Browse files
authored
Fix an issue in conda-package.yml (#2364)
In this PR, an issue in `conda-package.yml` file is fixed to properly run tests with all integer dtypes on windows when `DPNP_TEST_ALL_INT_TYPES=1`.
1 parent 70dea63 commit 25fb39b

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

.github/workflows/conda-package.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ jobs:
218218
- name: Run tests
219219
if: env.rerun-tests-on-failure != 'true'
220220
run: |
221-
if [[ ${{ matrix.python }} == ${{ env.python-ver-test-all-dtypes }} ]]; then
221+
if [[ "${{ matrix.python }}" == "${{ env.python-ver-test-all-dtypes }}" ]]; then
222222
export DPNP_TEST_ALL_INT_TYPES=1
223223
python -m pytest -ra --pyargs ${{ env.package-name }}.tests
224224
else
@@ -238,7 +238,7 @@ jobs:
238238
. $CONDA/etc/profile.d/mamba.sh
239239
mamba activate ${{ env.test-env-name }}
240240
241-
if [[ ${{ matrix.python }} == ${{ env.python-ver-test-all-dtypes }} ]]; then
241+
if [[ "${{ matrix.python }}" == "${{ env.python-ver-test-all-dtypes }}" ]]; then
242242
export DPNP_TEST_ALL_INT_TYPES=1
243243
python -m pytest -ra --pyargs ${{ env.package-name }}.tests
244244
else
@@ -383,9 +383,10 @@ jobs:
383383
384384
- name: Run tests
385385
if: env.rerun-tests-on-failure != 'true'
386+
shell: pwsh
386387
run: |
387388
if (${{ matrix.python }} -eq ${{ env.python-ver-test-all-dtypes }}) {
388-
set DPNP_TEST_ALL_INT_TYPES=1
389+
$env:DPNP_TEST_ALL_INT_TYPES=1
389390
python -m pytest -ra --pyargs ${{ env.package-name }}.tests
390391
} else {
391392
python -m pytest -n auto -ra --pyargs ${{ env.package-name }}.tests
@@ -399,9 +400,10 @@ jobs:
399400
timeout_minutes: ${{ env.rerun-tests-timeout }}
400401
max_attempts: ${{ env.rerun-tests-max-attempts }}
401402
retry_on: any
403+
shell: pwsh
402404
command: |
403405
if ( ${{ matrix.python }} -eq ${{ env.python-ver-test-all-dtypes }} ) {
404-
set DPNP_TEST_ALL_INT_TYPES=1
406+
$env:DPNP_TEST_ALL_INT_TYPES=1
405407
python -m pytest -ra --pyargs ${{ env.package-name }}.tests
406408
} else {
407409
python -m pytest -n auto -ra --pyargs ${{ env.package-name }}.tests

dpnp/tests/conftest.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
import numpy
3333
import pytest
3434

35+
from . import config as dtype_config
36+
3537
if numpy.lib.NumpyVersion(numpy.__version__) >= "2.0.0b1":
3638
from numpy.exceptions import ComplexWarning
3739
else:
@@ -128,20 +130,25 @@ def pytest_collection_modifyitems(config, items):
128130

129131
dev = dpctl.select_default_device()
130132
is_cpu = dev.is_cpu
131-
is_gpu_no_fp64 = not dev.has_aspect_fp64
133+
is_gpu = dev.is_gpu
134+
support_fp64 = dev.has_aspect_fp64
132135
is_cuda = dpnp.is_cuda_backend(dev)
133136

134137
print("")
138+
print(
139+
f"DPNP Test scope includes all integer dtypes: {bool(dtype_config.all_int_types)}"
140+
)
135141
print(f"DPNP current device is CPU: {is_cpu}")
136-
print(f"DPNP current device is GPU without fp64 support: {is_gpu_no_fp64}")
142+
print(f"DPNP current device is GPU: {is_gpu}")
143+
print(f"DPNP current device supports fp64: {support_fp64}")
137144
print(f"DPNP current device is GPU with cuda backend: {is_cuda}")
138145
print(f"DPNP version: {dpnp.__version__}, location: {dpnp}")
139146
print(f"NumPy version: {numpy.__version__}, location: {numpy}")
140147
print(f"Python version: {sys.version}")
141148
print("")
142-
if not is_cpu or os.getenv("DPNP_QUEUE_GPU") == "1":
149+
if is_gpu or os.getenv("DPNP_QUEUE_GPU") == "1":
143150
excluded_tests.extend(get_excluded_tests(test_exclude_file_gpu))
144-
if is_gpu_no_fp64:
151+
if not support_fp64:
145152
excluded_tests.extend(
146153
get_excluded_tests(test_exclude_file_gpu_no_fp64)
147154
)

0 commit comments

Comments
 (0)