]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
test_run: Skip a test if running in teuth process
authorZack Cerza <zack@redhat.com>
Thu, 3 Mar 2022 21:35:53 +0000 (14:35 -0700)
committerZack Cerza <zack@redhat.com>
Wed, 16 Mar 2022 22:51:16 +0000 (16:51 -0600)
Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/test/test_exit.py
teuthology/test/test_run.py

index 939bcadfbd12aa402490e7a2e3050e23e8acb44b..b7004fd75732f85049fb2de76bc5be8d7828ca88 100644 (file)
@@ -5,6 +5,7 @@ import signal
 from unittest.mock import patch, Mock
 
 from teuthology import exit
+from teuthology.test import skipif_teuthology_process
 
 
 class TestExiter(object):
@@ -39,6 +40,7 @@ class TestExiter(object):
         self.patcher_kill.stop()
         del self.m_kill
 
+    @skipif_teuthology_process
     def test_noop(self):
         sig = 15
         obj = self.klass()
index f08082f58c67ec6f21fb7f9980f6013b11ab0a12..5c99d755c0049d9d03e432613c7e1ae6fdb6ab44 100644 (file)
@@ -5,6 +5,7 @@ from unittest.mock import patch, call, Mock
 
 from teuthology import run
 from scripts import run as scripts_run
+from teuthology.test import skipif_teuthology_process
 
 
 class TestRun(object):
@@ -108,6 +109,13 @@ class TestRun(object):
         assert {'internal.vm_setup': None} in result
         assert {'internal.buildpackages_prep': None} in result
 
+    # When tests are run in a teuthology process using the py.test 
+    # API, tasks will have already been imported. Patching sys.path 
+    # (and even calling sys.path_importer_cache.clear()) doesn't seem 
+    # to help "forget" where the tasks are, keeping this test from 
+    # passing. The test isn't critical to run in every single 
+    # environment, so skip.
+    @skipif_teuthology_process
     @patch("teuthology.run.fetch_qa_suite")
     def test_fetch_tasks_if_needed(self, m_fetch_qa_suite):
         config = {"suite_path": "/some/suite/path", "suite_branch": "feature_branch",