Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Print error reports when tests fail #114

Merged
merged 3 commits into from
Jan 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions regtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,12 @@ def test_suite(argv):
if not test.compile_successful:
error_msg = "ERROR: compilation failed"
report.report_single_test(suite, test, test_list, failure_msg=error_msg)

# Print compilation error message (useful for CI tests)
if suite.verbose > 0:
with open(f"{output_dir}/{test.name}.make.out") as f:
print(f.read())

continue

if test.compileTest:
Expand Down Expand Up @@ -1079,6 +1085,11 @@ def test_suite(argv):
analysis_successful = False
suite.log.warn("analysis failed...")

# Print analysis error message (useful for CI tests)
if suite.verbose > 0:
with open(outfile) as f:
print(f.read())

test.analysis_successful = analysis_successful

else:
Expand Down
10 changes: 10 additions & 0 deletions suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,16 @@ def run_test(self, test, base_command):
test.run_command = test_run_command
test.return_code = ierr

# Print compilation error message (useful for CI tests)
if test.return_code != 0 and self.verbose > 0:
self.log.warn("Test stdout:")
with open(f"{outfile}") as f:
print(f.read())
if os.path.isfile(errfile):
self.log.warn("Test stderr:")
with open(f"{errfile}") as f:
ax3l marked this conversation as resolved.
Show resolved Hide resolved
print(f.read())

def copy_backtrace(self, test):
"""
if any backtrace files were output (because the run crashed), find them
Expand Down