Skip to content

Commit

Permalink
[CI] Print stderr in run_tests.py (#443)
Browse files Browse the repository at this point in the history
For `run_tests.py` (Regression) output subtests' `stderr`. "Compiling..." from hidet go there.

[Example of output in Regression
logs](https://github.com/CentML/hidet/actions/runs/10625143157/job/29454729970)
  • Loading branch information
vadiklyutiy authored Sep 16, 2024
1 parent 2a5a881 commit 6563486
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/benchmarks/run_tests.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import sys
import json
import subprocess
import pathlib
Expand All @@ -11,13 +12,16 @@
def run_command(cmd):
cmd = " ".join(cmd)
print("Running command: " + cmd)
sys.stdout.flush()
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, shell=True)

for line in iter(process.stderr.readline, ''):
sys.stderr.write(line)
sys.stderr.flush()

stdout, stderr = process.communicate()
ret = process.returncode
if ret:
print('STDERR:')
for line in stderr:
print(line, end='')
raise RuntimeError(f'Command {cmd} failed with return code {ret}.')
return stdout

Expand Down

0 comments on commit 6563486

Please sign in to comment.