diff --git a/test_runner/fixtures/neon_fixtures.py b/test_runner/fixtures/neon_fixtures.py index c8b970100b..feac846a4c 100644 --- a/test_runner/fixtures/neon_fixtures.py +++ b/test_runner/fixtures/neon_fixtures.py @@ -1085,15 +1085,32 @@ class AbstractNeonCli(abc.ABC): stderr=subprocess.PIPE, timeout=timeout, ) + + indent = " " if not res.returncode: - log.info(f"Run {res.args} success: {res.stdout}") + stripped = res.stdout.strip() + lines = stripped.splitlines() + if len(lines) < 2: + log.debug(f"Run {res.args} success: {stripped}") + else: + log.debug("Run %s success:\n%s" % (res.args, textwrap.indent(stripped, indent))) elif check_return_code: # this way command output will be in recorded and shown in CI in failure message - msg = f"""\ - Run {res.args} failed: - stdout: {res.stdout} - stderr: {res.stderr} + indent = indent * 2 + msg = textwrap.dedent( + """\ + Run %s failed: + stdout: + %s + stderr: + %s """ + ) + msg = msg % ( + res.args, + textwrap.indent(res.stdout.strip(), indent), + textwrap.indent(res.stderr.strip(), indent), + ) log.info(msg) raise RuntimeError(msg) from subprocess.CalledProcessError( res.returncode, res.args, res.stdout, res.stderr