summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/frontend/artifact_log.py8
-rw-r--r--tests/frontend/logging.py2
2 files changed, 7 insertions, 3 deletions
diff --git a/tests/frontend/artifact_log.py b/tests/frontend/artifact_log.py
index 6ea610a25..8fd51ea2a 100644
--- a/tests/frontend/artifact_log.py
+++ b/tests/frontend/artifact_log.py
@@ -19,6 +19,7 @@
# pylint: disable=redefined-outer-name
import os
+import re
import pytest
from buildstream.testing import cli # pylint: disable=unused-import
@@ -88,9 +89,12 @@ def test_artifact_log_files(cli, datafiles):
assert os.path.exists(import_bin)
# Ensure the file contains the logs by checking for the LOG line
+ pattern = r"\[..:..:..\] LOG \[.*\] target.bst"
with open(target, "r") as f:
data = f.read()
- assert "LOG target.bst" in data
+ assert len(re.findall(pattern, data, re.MULTILINE)) > 0
+
+ pattern = r"\[..:..:..\] LOG \[.*\] import-bin.bst"
with open(import_bin, "r") as f:
data = f.read()
- assert "LOG import-bin.bst" in data
+ assert len(re.findall(pattern, data, re.MULTILINE)) > 0
diff --git a/tests/frontend/logging.py b/tests/frontend/logging.py
index 6eb058990..a86bda577 100644
--- a/tests/frontend/logging.py
+++ b/tests/frontend/logging.py
@@ -106,5 +106,5 @@ def test_failed_build_listing(cli, datafiles):
# Note that if we mess up the 'element_name' 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'"
+ 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.