From 5ada9bebf67025b6663c2b0055ac93f0bc70bef2 Mon Sep 17 00:00:00 2001 From: Austin Raney Date: Mon, 5 Feb 2024 10:33:22 -0500 Subject: [PATCH] test: skip schduler integration tests if in CI --- .../scheduler/dmod/test/it_RedisBackedJobManager.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/python/lib/scheduler/dmod/test/it_RedisBackedJobManager.py b/python/lib/scheduler/dmod/test/it_RedisBackedJobManager.py index fb43ffa49..280f8ad15 100644 --- a/python/lib/scheduler/dmod/test/it_RedisBackedJobManager.py +++ b/python/lib/scheduler/dmod/test/it_RedisBackedJobManager.py @@ -13,7 +13,18 @@ # TODO: also add another test for the job manager factory and its factory method - +try: + import pytest + import os + # https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables + in_ci = os.environ.get("CI", False) == "true" + skip_in_ci = pytest.mark.skipif(in_ci, reason="Tests require access to Docker Daemon. Do not have access to Docker Daemon in GH Actions.") +except ImportError: + def skip_in_ci(fn): + return fn + + +@skip_in_ci class IntegrationTestRedisBackedJobManager(unittest.TestCase): _TEST_ENV_FILE_BASENAME = ".test_env"