From d1b300ead9156c1e1e09135cf82d7ef7439eb5ee Mon Sep 17 00:00:00 2001 From: Ashwin Bharambe Date: Thu, 31 Jul 2025 12:31:40 -0700 Subject: [PATCH] fix(ci, nvidia): do not use module level pytest skip for now --- tests/integration/providers/nvidia/__init__.py | 11 +++++++++++ tests/integration/providers/nvidia/conftest.py | 14 -------------- .../integration/providers/nvidia/test_datastore.py | 3 +++ 3 files changed, 14 insertions(+), 14 deletions(-) delete mode 100644 tests/integration/providers/nvidia/conftest.py diff --git a/tests/integration/providers/nvidia/__init__.py b/tests/integration/providers/nvidia/__init__.py index 756f351d8..ec98e3b7a 100644 --- a/tests/integration/providers/nvidia/__init__.py +++ b/tests/integration/providers/nvidia/__init__.py @@ -3,3 +3,14 @@ # # This source code is licensed under the terms described in the LICENSE file in # the root directory of this source tree. + +import os + +import pytest + +# Reusable skip decorator for NVIDIA tests in GitHub Actions +# Adding this in conftest.py as a module level skip statement causes pytest to error +# out in certain cases. +skip_in_github_actions = pytest.mark.skipif( + os.environ.get("GITHUB_ACTIONS") == "true", reason="Skipping NVIDIA tests in GitHub Actions environment" +) diff --git a/tests/integration/providers/nvidia/conftest.py b/tests/integration/providers/nvidia/conftest.py deleted file mode 100644 index 8beb113b0..000000000 --- a/tests/integration/providers/nvidia/conftest.py +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -import os - -import pytest - -# Skip all tests in this directory when running in GitHub Actions -in_github_actions = os.environ.get("GITHUB_ACTIONS") == "true" -if in_github_actions: - pytest.skip("Skipping NVIDIA tests in GitHub Actions environment", allow_module_level=True) diff --git a/tests/integration/providers/nvidia/test_datastore.py b/tests/integration/providers/nvidia/test_datastore.py index 5f96dee9f..5cddd7781 100644 --- a/tests/integration/providers/nvidia/test_datastore.py +++ b/tests/integration/providers/nvidia/test_datastore.py @@ -7,12 +7,15 @@ import pytest +from . import skip_in_github_actions + # How to run this test: # # LLAMA_STACK_CONFIG="nvidia" pytest -v tests/integration/providers/nvidia/test_datastore.py # nvidia provider only +@skip_in_github_actions @pytest.mark.parametrize( "provider_id", [