From af6d0e1fa3d585aca218db12f5765e3594b36bb6 Mon Sep 17 00:00:00 2001 From: Stefano Castagnetta Date: Thu, 30 Apr 2026 18:33:47 +0200 Subject: [PATCH 1/2] [CI/Build] Skip Prithvi/Terratorch model-registry tests when terratorch is missing Follow-up to #41377. After dropping terratorch from the test deps, two model-registry parametrize tests started failing on every PR that re-ran those jobs against current main: tests/models/test_initialization.py::test_can_initialize_small_subset[PrithviGeoSpatialMAE] tests/models/test_registry.py::test_registry_imports[PrithviGeoSpatialMAE] tests/models/test_registry.py::test_registry_imports[Terratorch] Both tests reach Prithvi via the model-registry parametrize, so they were not covered by the per-file pytest.importorskip guards added in #41377. Add inline skips matching the existing precedent in test_initialization.py (`if model_arch == "MoonshotKimiaForCausalLM": pytest.skip(...)`), gated on `importlib.util.find_spec("terratorch")`. The skips no-op once terratorch is restored to the lockfiles. Signed-off-by: Stefano Castagnetta --- tests/models/test_initialization.py | 10 ++++++++++ tests/models/test_registry.py | 11 +++++++++++ 2 files changed, 21 insertions(+) diff --git a/tests/models/test_initialization.py b/tests/models/test_initialization.py index 979c8d31775c..476ad1c7c17f 100644 --- a/tests/models/test_initialization.py +++ b/tests/models/test_initialization.py @@ -109,6 +109,16 @@ def _initialize_kv_caches_v1(self, vllm_config): "which is not configured in test environment" ) + if model_arch in ("PrithviGeoSpatialMAE", "Terratorch"): + import importlib.util + + if importlib.util.find_spec("terratorch") is None: + pytest.skip( + "terratorch is not installed; " + "temporarily skipped while PyPI has `lightning` quarantined " + "(see #41376)" + ) + if model_arch in ["DeepseekV32ForCausalLM", "GlmMoeDsaForCausalLM"]: from vllm.platforms import current_platform diff --git a/tests/models/test_registry.py b/tests/models/test_registry.py index 81fae02efda1..0715409abda6 100644 --- a/tests/models/test_registry.py +++ b/tests/models/test_registry.py @@ -36,6 +36,17 @@ def test_registry_imports(model_arch): check_max_version=False, check_version_reason="vllm", ) + + if model_arch in ("PrithviGeoSpatialMAE", "Terratorch"): + import importlib.util + + if importlib.util.find_spec("terratorch") is None: + pytest.skip( + "terratorch is not installed; " + "temporarily skipped while PyPI has `lightning` quarantined " + "(see #41376)" + ) + # Ensure all model classes can be imported successfully model_cls = ModelRegistry._try_load_model_cls(model_arch) assert model_cls is not None From 7c35538c209085ae00243b9aaedfbcb38c48c7a7 Mon Sep 17 00:00:00 2001 From: Stefano Castagnetta Date: Thu, 30 Apr 2026 19:08:03 +0200 Subject: [PATCH 2/2] [CI/Build] Convert terratorch importorskip to pytestmark.skipif MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Module-level `pytest.importorskip("terratorch")` from #41377 caused the plugin-tests-2-gpus job to exit with status 5 ("no tests collected") because the importorskip raised at *collection time* — pytest reported "0 collected, 1 skipped" and the CI's pytest-shard plugin then exits 5 on the empty shard. The CI's `set -e` propagates that as a failure. Switch to `pytestmark = pytest.mark.skipif(...)` so pytest enumerates the test items first, then marks each as SKIPPED at run-time. Net effect: pytest reports "N collected, N skipped" and exits 0 on the same condition. Verified locally on a dlcluster GB200 node with the same pytest plugin set as CI (pytest-shard, pytest-rerunfailures, pytest-forked): plugins_tests/test_terratorch_io_processor_plugins.py | exit=0 | 4 skipped models/test_terratorch.py | exit=0 | 2 skipped models/multimodal/pooling/test_prithvi_mae.py | exit=0 | 1 skipped When terratorch is restored to the lockfiles, `find_spec` returns truthy, the skipif evaluates False, and the tests run normally. Signed-off-by: Stefano Castagnetta --- tests/models/multimodal/pooling/test_prithvi_mae.py | 6 ++++-- tests/models/test_terratorch.py | 6 ++++-- tests/plugins_tests/test_terratorch_io_processor_plugins.py | 5 +++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/tests/models/multimodal/pooling/test_prithvi_mae.py b/tests/models/multimodal/pooling/test_prithvi_mae.py index 6340a07c83b2..1a466931a0e5 100644 --- a/tests/models/multimodal/pooling/test_prithvi_mae.py +++ b/tests/models/multimodal/pooling/test_prithvi_mae.py @@ -1,13 +1,15 @@ # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project +import importlib.util + import pytest import torch from ....conftest import VllmRunner -pytest.importorskip( - "terratorch", +pytestmark = pytest.mark.skipif( + importlib.util.find_spec("terratorch") is None, reason="terratorch unavailable while PyPI has `lightning` quarantined; see #41376", ) diff --git a/tests/models/test_terratorch.py b/tests/models/test_terratorch.py index fccc635a0dcf..6d4d1921a88d 100644 --- a/tests/models/test_terratorch.py +++ b/tests/models/test_terratorch.py @@ -1,14 +1,16 @@ # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project +import importlib.util + import pytest import torch from tests.conftest import VllmRunner from tests.utils import create_new_process_for_each_test -pytest.importorskip( - "terratorch", +pytestmark = pytest.mark.skipif( + importlib.util.find_spec("terratorch") is None, reason="terratorch unavailable while PyPI has `lightning` quarantined; see #41376", ) diff --git a/tests/plugins_tests/test_terratorch_io_processor_plugins.py b/tests/plugins_tests/test_terratorch_io_processor_plugins.py index 01e120a24406..b4c84b30d2ca 100644 --- a/tests/plugins_tests/test_terratorch_io_processor_plugins.py +++ b/tests/plugins_tests/test_terratorch_io_processor_plugins.py @@ -1,5 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project +import importlib.util import io import imagehash @@ -11,8 +12,8 @@ from tests.utils import RemoteOpenAIServer from vllm.entrypoints.pooling.pooling.protocol import IOProcessorResponse -pytest.importorskip( - "terratorch", +pytestmark = pytest.mark.skipif( + importlib.util.find_spec("terratorch") is None, reason="terratorch unavailable while PyPI has `lightning` quarantined; see #41376", )