From 167303b84bc2914579679fc1f8d8d3ebd134ce20 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 12 Nov 2024 09:32:45 -0500 Subject: [PATCH] skip distro tests --- bbot/test/test_step_2/module_tests/base.py | 4 +++- bbot/test/test_step_2/module_tests/test_module_dastardly.py | 1 + bbot/test/test_step_2/module_tests/test_module_postgres.py | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bbot/test/test_step_2/module_tests/base.py b/bbot/test/test_step_2/module_tests/base.py index acdb37c50a..47038e9aef 100644 --- a/bbot/test/test_step_2/module_tests/base.py +++ b/bbot/test/test_step_2/module_tests/base.py @@ -20,6 +20,8 @@ class ModuleTestBase: config_overrides = {} modules_overrides = None log = logging.getLogger("bbot") + # if True, the test will be skipped (useful for tests that require docker) + skip_distro_tests = False class ModuleTest: def __init__( @@ -90,7 +92,7 @@ async def module_test( self, httpx_mock, bbot_httpserver, bbot_httpserver_ssl, monkeypatch, request, caplog, capsys ): # Skip dastardly test if we're in the distro tests (because dastardly uses docker) - if os.getenv("BBOT_DISTRO_TESTS") and self.name == "dastardly": + if os.getenv("BBOT_DISTRO_TESTS") and self.skip_distro_tests: pytest.skip("Skipping module_test for dastardly module due to BBOT_DISTRO_TESTS environment variable") self.log.info(f"Starting {self.name} module test") diff --git a/bbot/test/test_step_2/module_tests/test_module_dastardly.py b/bbot/test/test_step_2/module_tests/test_module_dastardly.py index cb4a501b8b..98fa024535 100644 --- a/bbot/test/test_step_2/module_tests/test_module_dastardly.py +++ b/bbot/test/test_step_2/module_tests/test_module_dastardly.py @@ -7,6 +7,7 @@ class TestDastardly(ModuleTestBase): targets = ["http://127.0.0.1:5556/"] modules_overrides = ["httpx", "dastardly"] + skip_distro_tests = True web_response = """ diff --git a/bbot/test/test_step_2/module_tests/test_module_postgres.py b/bbot/test/test_step_2/module_tests/test_module_postgres.py index c511a89af6..874acdb195 100644 --- a/bbot/test/test_step_2/module_tests/test_module_postgres.py +++ b/bbot/test/test_step_2/module_tests/test_module_postgres.py @@ -6,6 +6,7 @@ class TestPostgres(ModuleTestBase): targets = ["evilcorp.com"] + skip_distro_tests = True async def setup_before_prep(self, module_test): process = await asyncio.create_subprocess_exec(