Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Tests/kaas/sonobuoy_handler/sonobuoy_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import shlex
import shutil
import subprocess
import sys

import yaml

Expand Down Expand Up @@ -65,7 +66,7 @@ def _invoke_sonobuoy(self, *args, **kwargs):
inv_args = (self.sonobuoy, "--kubeconfig", self.kubeconfig_path) + args
logger.debug(f'invoking {" ".join(inv_args)}')
# we had capture_output=True, but I don't see why -- let the caller decide
return subprocess.run(args=inv_args, check=True, **kwargs)
return subprocess.run(args=inv_args, check=True, stdout=sys.stderr, **kwargs)

def _sonobuoy_run(self):
self._invoke_sonobuoy("run", "--wait", *self.args)
Expand Down Expand Up @@ -113,13 +114,15 @@ def run(self):
logger.info(f"running sonobuoy for testcase {self.check_name}")
self._preflight_check()
try:
self._sonobuoy_delete() # remove leftovers from previous run, if any
self._sonobuoy_run()
counter = self._sonobuoy_retrieve_result()
return_code = self._eval_result(counter)
print(self.check_name + ": " + ("PASS", "FAIL")[min(1, return_code)])
return return_code
except BaseException:
logger.exception("something went wrong")
print(self.check_name + ": ABORT")
logger.critical("something went wrong", exc_info=True)
return 112
finally:
self._sonobuoy_delete()
Expand Down
Loading