diff --git a/.azure-pipelines/ipu-tests.yml b/.azure-pipelines/ipu-tests.yml index ad9cd8623a..caa3df86a7 100644 --- a/.azure-pipelines/ipu-tests.yml +++ b/.azure-pipelines/ipu-tests.yml @@ -76,7 +76,8 @@ jobs: source ${{ variables.poplar_sdk }}/poplar-ubuntu*/enable.sh source ${{ variables.poplar_sdk }}/popart-ubuntu*/enable.sh export POPTORCH_WAIT_FOR_IPU=1 - python -m coverage run --source pytorch_lightning -m pytest tests/accelerators/test_ipu.py -v --junitxml=$(Build.StagingDirectory)/test-results.xml --durations=50 + export PL_RUN_IPU_TESTS=1 + python -m coverage run --source pytorch_lightning -m pytest tests -vv --junitxml=$(Build.StagingDirectory)/test-results.xml --durations=50 env: MKL_THREADING_LAYER: "GNU" displayName: 'Testing: standard' diff --git a/tests/conftest.py b/tests/conftest.py index 16e7f22bd3..cdb1bfbd39 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -190,3 +190,11 @@ def pytest_collection_modifyitems(items): # has `@RunIf(slow=True)` if marker.name == "skipif" and marker.kwargs.get("slow") ] + elif os.getenv("PL_RUN_IPU_TESTS", "0") == "1": + items[:] = [ + item + for item in items + for marker in item.own_markers + # has `@RunIf(ipu=True)` + if marker.name == "skipif" and marker.kwargs.get("ipu") + ] diff --git a/tests/helpers/runif.py b/tests/helpers/runif.py index b81a1b1fdf..f52aada92e 100644 --- a/tests/helpers/runif.py +++ b/tests/helpers/runif.py @@ -149,8 +149,10 @@ class RunIf: reasons.append("TPU") if ipu: - conditions.append(not _IPU_AVAILABLE) + env_flag = os.getenv("PL_RUN_IPU_TESTS", "0") + conditions.append(env_flag != "1" or not _IPU_AVAILABLE) reasons.append("IPU") + kwargs["ipu"] = True if horovod: conditions.append(not _HOROVOD_AVAILABLE)