Skip to content

Commit

Permalink
Avoid host(s) removal in plugins-integration
Browse files Browse the repository at this point in the history
When the global variable CLEANUP is set to 1, the test-site in the
plugins-tests is not removed.
Similarly, the created host(s) should not be removed as well.
This change takes care of this.

Change-Id: I6032d81d28045a7da3b2357ff7bd641d510deae1
  • Loading branch information
MatteoStifano committed Nov 13, 2023
1 parent ea00489 commit bc054f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/plugins_integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def pytest_addoption(parser):
parser.addoption(
"--skip-cleanup",
action="store_true",
default=False,
default=os.getenv("CLEANUP", "1") != "1",
help="Skip cleanup process after test execution",
)
parser.addoption(
Expand Down Expand Up @@ -188,7 +188,7 @@ def _get_site(request: pytest.FixtureRequest) -> Iterator[Site]:

yield site

if os.getenv("CLEANUP", "1") == "1" and not skip_cleanup:
if not skip_cleanup:
# cleanup existing agent-output folder in the test site
logger.info('Removing folder "%s"...', dump_path)
assert run(["sudo", "rm", "-rf", dump_path]).returncode == 0
Expand Down

0 comments on commit bc054f9

Please sign in to comment.