From e26eae97aa984fdc45dd9f55cf14ab4a7731c706 Mon Sep 17 00:00:00 2001 From: Dhananjay Shah Date: Fri, 16 Aug 2024 15:27:23 +0200 Subject: [PATCH] test-plugin-piggyback: improved skipping of piggyback tests. Skip setup & teardown steps as well of skipped `piggyback tests`. Undesired setup & teardown steps were executed within `plugin tests`, which resulted in CI jobs timing out. Change-Id: I97f592e1a56928794450c5bede117d15e6db47f9 --- tests/plugins_integration/conftest.py | 3 +++ tests/plugins_integration/test_plugin_piggyback.py | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/plugins_integration/conftest.py b/tests/plugins_integration/conftest.py index 5c156dab3ce..b9c717e2ce3 100644 --- a/tests/plugins_integration/conftest.py +++ b/tests/plugins_integration/conftest.py @@ -181,6 +181,9 @@ def _get_site(request: pytest.FixtureRequest) -> Iterator[Site]: # Todo: perform a proper site-cleanup and change this fixture's scope: CMK-18659 @pytest.fixture(name="test_site_piggyback", scope="function") def _get_site_piggyback(request: pytest.FixtureRequest) -> Iterator[Site]: + if not request.config.getoption(name="--enable-piggyback"): + pytest.skip("Piggyback tests are not selected.") + for site in get_site_factory(prefix="PB_").get_test_site( auto_cleanup=not checks.config.skip_cleanup ): diff --git a/tests/plugins_integration/test_plugin_piggyback.py b/tests/plugins_integration/test_plugin_piggyback.py index f2823974960..92668f91578 100644 --- a/tests/plugins_integration/test_plugin_piggyback.py +++ b/tests/plugins_integration/test_plugin_piggyback.py @@ -28,10 +28,7 @@ def test_plugin_piggyback( test_site_piggyback: Site, source_host_name: str, dcd_connector: None, - pytestconfig: pytest.Config, ) -> None: - if not pytestconfig.getoption(name="--enable-piggyback"): - pytest.skip("Piggyback tests are not selected.") with setup_source_host_piggyback(test_site_piggyback, source_host_name): disk_dump = read_disk_dump(source_host_name)