diff options
author | Angelos Evripiotis <angelos.evripiotis@gmail.com> | 2019-05-22 09:29:15 +0000 |
---|---|---|
committer | Angelos Evripiotis <angelos.evripiotis@gmail.com> | 2019-05-22 09:29:15 +0000 |
commit | d43ba46b11f1356d6014b3aa8593e896a45aed58 (patch) | |
tree | 941a978889885049523e0cb2aff9ad84aa8f94ff | |
parent | 25172ed2d7b39cab799b1f2788d818d39ce3ee33 (diff) | |
parent | c7430dd6941bde02477b146aa1b9a84a18db60a3 (diff) | |
download | buildstream-d43ba46b11f1356d6014b3aa8593e896a45aed58.tar.gz |
Merge branch 'aevri/fix_logging_regex_test' into 'master'
tests/frontend/logging.py: fix error message regex
See merge request BuildStream/buildstream!1348
-rw-r--r-- | tests/frontend/logging.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/frontend/logging.py b/tests/frontend/logging.py index e7279ac4c..31a2dd909 100644 --- a/tests/frontend/logging.py +++ b/tests/frontend/logging.py @@ -109,8 +109,19 @@ def test_failed_build_listing(cli, datafiles): result = cli.run(project=project, args=['--on-error=continue', 'build', *element_names]) result.assert_main_error(ErrorDomain.STREAM, None) + # Check that we re-print the failure summaries only in the "Failure Summary" + # section. + # e.g. + # + # Failure Summary + # testfail-0.bst: + # [00:00:00][44f1b8c3][ build:testfail-0.bst ] FAILURE Running 'commands' + # failure_heading_pos = re.search(r'^Failure Summary$', result.stderr, re.MULTILINE).start() pipeline_heading_pos = re.search(r'^Pipeline Summary$', result.stderr, re.MULTILINE).start() failure_summary_range = range(failure_heading_pos, pipeline_heading_pos) - assert all(m.start() in failure_summary_range and m.end() in failure_summary_range - for m in re.finditer(r'^\s+testfail-.\.bst.+?\s+Log file', result.stderr, re.MULTILINE)) + matches = tuple(re.finditer(r'^\s+testfail-.\.bst:$', result.stderr, re.MULTILINE)) + for m in matches: + assert m.start() in failure_summary_range + assert m.end() in failure_summary_range + assert len(matches) == 3 # each element should be matched once. |