Skip to content

Commit 80f5ec2

Browse files
committed
Log stdout and stderr in CSV coverage jobs
1 parent 1d8fae4 commit 80f5ec2

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

misc/scripts/library-coverage/utils.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,16 @@
88
def subprocess_run(cmd):
99
"""Runs a command through subprocess.run, with a few tweaks. Raises an Exception if exit code != 0."""
1010
print(shlex.join(cmd))
11-
return subprocess.run(cmd, capture_output=True, text=True, env=os.environ.copy(), check=True)
11+
try:
12+
ret = subprocess.run(cmd, capture_output=True,
13+
text=True, env=os.environ.copy(), check=True)
14+
if (ret.stdout):
15+
print(ret.stdout)
16+
return ret
17+
except subprocess.CalledProcessError as e:
18+
if (e.stderr):
19+
print(e.stderr)
20+
raise e
1221

1322

1423
def subprocess_check_output(cmd):

0 commit comments

Comments
 (0)