Skip to content

Commit

Permalink
Skip tests that require a GPU to pass
Browse files Browse the repository at this point in the history
  • Loading branch information
dyastremsky committed May 9, 2024
1 parent 04a552a commit 1f039db
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/python-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-22.04"]
python-version: ["3.8", "3.10"]
python-version: ["3.8", "3.11"]
env:
SKIP_GPU_TESTS: 1 # Set this variable to skip GPU tests

steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 4 additions & 0 deletions tests/test_model_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ def test_write_config_to_file_with_relative_path(self, mock_os_symlink, *args):

def test_instance_group_string(self):
"""Test out all corner cases of instance_group_string()"""
if os.getenv("SKIP_GPU_TESTS"):
self.skipTest("Skipping this test as it requires GPU")

def _test_helper(config_dict, expected_result, gpu_count=None):
model_config = ModelConfig.create_from_dictionary(config_dict)
Expand Down Expand Up @@ -318,6 +320,8 @@ def _test_helper(config_dict, expected_result, gpu_count=None):

def test_instance_group_count(self):
"""Test out all corner cases of instance_group_count()"""
if os.getenv("SKIP_GPU_TESTS"):
self.skipTest("Skipping this test as it requires GPU")

def _test_helper(config_dict, expected_result, gpu_count=None):
model_config = ModelConfig.create_from_dictionary(config_dict)
Expand Down
3 changes: 3 additions & 0 deletions tests/test_result_table_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os
import unittest
from filecmp import cmp
from shutil import rmtree
Expand Down Expand Up @@ -79,6 +80,8 @@ def test_multi_model_csv_against_golden(self):
Match the csvs against the golden versions in
tests/common/multi-model-ckpt
"""
if os.getenv("SKIP_GPU_TESTS"):
self.skipTest("Skipping this test as it requires GPU")
table_manager = self._create_multi_model_result_table_manager()

table_manager.create_tables()
Expand Down

0 comments on commit 1f039db

Please sign in to comment.