diff options
author | Jake Hunsaker <jhunsake@redhat.com> | 2022-01-05 12:22:36 -0500 |
---|---|---|
committer | Jake Hunsaker <jhunsake@redhat.com> | 2022-01-05 17:10:48 -0500 |
commit | 10db69ae0468c56cf23a1d4585d860e657fdc37c (patch) | |
tree | cf67a55cddcc838d4cf7735106e5e28ac19ebae7 /tests/sos_tests.py | |
parent | 0a9e5dfc6b022b510498131ccc7aebbcbe1ec6b3 (diff) | |
download | sos-10db69ae0468c56cf23a1d4585d860e657fdc37c.tar.gz |
[tests] Do not remove temp dirs from failed CI test runs
In the event a CI test execution fails before the archive is created,
for any reason, we want to preserve the temp directory as the logs there
are still useful.
As such, add a specific env var to our test runs via avocado. Then, when
we detect a failure check for that env var to determine if we should in
fact do our cleanup or not.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
Diffstat (limited to 'tests/sos_tests.py')
-rw-r--r-- | tests/sos_tests.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/sos_tests.py b/tests/sos_tests.py index a1c68353..b7f7243c 100644 --- a/tests/sos_tests.py +++ b/tests/sos_tests.py @@ -121,7 +121,8 @@ class BaseSoSTest(Test): """ exec_cmd = self._generate_sos_command() try: - self.cmd_output = process.run(exec_cmd, timeout=self.sos_timeout) + self.cmd_output = process.run(exec_cmd, timeout=self.sos_timeout, + env={'SOS_TEST_LOGS': 'keep'}) except Exception as err: if not hasattr(err, 'result'): # can't inspect the exception raised, just bail out |