From 01ef2baef0825106ae6d8683d7502f877836958a Mon Sep 17 00:00:00 2001 From: Dmitry Rodionov Date: Tue, 14 Sep 2021 18:36:19 +0300 Subject: [PATCH] show more context for zenith cli run errors --- test_runner/fixtures/zenith_fixtures.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/test_runner/fixtures/zenith_fixtures.py b/test_runner/fixtures/zenith_fixtures.py index 82312a992b..1c97e886fc 100644 --- a/test_runner/fixtures/zenith_fixtures.py +++ b/test_runner/fixtures/zenith_fixtures.py @@ -185,12 +185,16 @@ class ZenithCli: universal_newlines=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - except subprocess.CalledProcessError as err: - print(f"Run failed: {err}") - print(f" stdout: {err.stdout}") - print(f" stderr: {err.stderr}") + except subprocess.CalledProcessError as exc: + # this way command output will be in recorded and shown in CI in failure message + msg = f"""\ + Run failed: {exc} + stdout: {exc.stdout} + stderr: {exc.stderr} + """ + print(msg) - raise err + raise Exception(msg) from exc return res