Skip to content

Commit

Permalink
sanity checks: print test failures for analysis even better
Browse files Browse the repository at this point in the history
Due to parallel work, we both implemented this functionality at the
same time. Switch to my implementation, which has the following
advantages:

- Use some fancy github output labeling to print the entire testlog,
  which causes it to be a collapsible element in the github UI.

- Use --print-errorlogs, which causes the stderr of failing tests (and
  only that) to be printed by default, something that ninja test already
  does ;) because it is smart. Sometimes the failures are obvious from
  there, although not always -- in the case of libuv which prompted
  this, the error output is part of the TAP stream on stdout, and
  errorlogs are only printed based on stderr.
  • Loading branch information
eli-schwartz committed Oct 21, 2021
1 parent 75bfc52 commit d6ae884
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tools/sanity_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,14 +239,18 @@ def check_new_release(self, name: str, builddir: str = '_build'):
subprocess.check_call(['meson', 'setup', builddir] + options)
except subprocess.CalledProcessError:
log_file = Path(builddir, 'meson-logs', 'meson-log.txt')
print('\n\n==== meson-logs.txt ====\n', log_file.read_text(encoding='utf-8'))
print('::group::==== meson-log.txt ====')
print(log_file.read_text(encoding='utf-8'))
print('::endgroup::')
raise
subprocess.check_call(['meson', 'compile', '-C', builddir])
try:
subprocess.check_call(['meson', 'test', '-C', builddir])
subprocess.check_call(['meson', 'test', '-C', builddir, '--print-errorlogs'])
except subprocess.CalledProcessError:
log_file = Path(builddir, 'meson-logs', 'testlog.txt')
print('\n\n==== testlog.txt ====\n', log_file.read_text(encoding='utf-8'))
print('::group::==== testlog.txt ====')
print(log_file.read_text(encoding='utf-8'))
print('::endgroup::')
raise

def is_permitted_file(self, subproject: str, filename: str):
Expand Down

0 comments on commit d6ae884

Please sign in to comment.