diff options
author | Angelos Evripiotis <jevripiotis@bloomberg.net> | 2019-05-08 11:39:05 +0100 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-05-23 14:57:46 +0000 |
commit | 1df674c74e83e8f40c1228c0c67504491d89e12c (patch) | |
tree | 902373080317fd5e57920e4cbebcec80f200d855 /tests | |
parent | 91c3000ba542efa8540aabce4990d6c8bd7ac858 (diff) | |
download | buildstream-1df674c74e83e8f40c1228c0c67504491d89e12c.tar.gz |
jobs: refactor, use new set_message_unique_id
Ease the burden on subclasses of Job slightly, by providing a new
set_message_unique_id() method. It ensures that created Message
instances will use that id.
This removes the need to override the message() method, so it is no
longer in the 'abstract method' section.
Enable callers to Job's message() method to override the 'unique_id'.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/frontend/logging.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/frontend/logging.py b/tests/frontend/logging.py index 31a2dd909..a8f894976 100644 --- a/tests/frontend/logging.py +++ b/tests/frontend/logging.py @@ -125,3 +125,9 @@ def test_failed_build_listing(cli, datafiles): assert m.start() in failure_summary_range assert m.end() in failure_summary_range assert len(matches) == 3 # each element should be matched once. + + # Note that if we mess up the 'unique_id' of Messages, they won't be printed + # with the name of the relevant element, e.g. 'testfail-1.bst'. Check that + # they have the name as expected. + pattern = r"\[..:..:..\] FAILURE testfail-.\.bst: Staged artifacts do not provide command 'sh'" + assert len(re.findall(pattern, result.stderr, re.MULTILINE)) == 6 # each element should be matched twice. |