Skip to content

Commit

Permalink
skip distro tests
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Nov 13, 2024
1 parent e69b561 commit 167303b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bbot/test/test_step_2/module_tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__(
Expand Down Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
class TestDastardly(ModuleTestBase):
targets = ["http://127.0.0.1:5556/"]
modules_overrides = ["httpx", "dastardly"]
skip_distro_tests = True

web_response = """<!DOCTYPE html>
<html>
Expand Down
1 change: 1 addition & 0 deletions bbot/test/test_step_2/module_tests/test_module_postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 167303b

Please sign in to comment.