From 7c33658b57c3bddc717d96ddbc7af59ded7d9005 Mon Sep 17 00:00:00 2001 From: Marius van den Beek Date: Sat, 18 Jun 2022 17:02:10 +0200 Subject: [PATCH] Capture output of kubectl command Co-authored-by: Nicola Soranzo --- test/integration/test_kubernetes_runner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/test_kubernetes_runner.py b/test/integration/test_kubernetes_runner.py index f988ca4c585..915716dc3ad 100644 --- a/test/integration/test_kubernetes_runner.py +++ b/test/integration/test_kubernetes_runner.py @@ -325,7 +325,7 @@ class BaseKubernetesIntegrationTestCase(BaseJobEnvironmentIntegrationTestCase, M external_id = job.job_runner_external_id log_cmd = ["kubectl", "logs", "-l", f"job-name={external_id}"] - p = subprocess.run(log_cmd) + p = subprocess.run(log_cmd, capture_output=True, text=True) if p.returncode: raise Exception( f"Command '{shlex.join(log_cmd)}' failed with exit code: {p.returncode}.\nstdout: {p.stdout}\nstderr: {p.stderr}"