summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-01-09 17:33:02 -0500
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-01-10 15:03:52 -0500
commit630e26f125025781268af3c6553faa57e8441a7c (patch)
tree6cbfd59e94ec4428c0cd0f59b5fcdb4539cb668d
parent0b83d024920e319d0fefcba34d22ced490e185d0 (diff)
downloadbuildstream-630e26f125025781268af3c6553faa57e8441a7c.tar.gz
testutils/runcli.py: Added Result.get_start_order()
Added a function to report the list of elements which appeared in a given queue in the order of their first appearance.
-rw-r--r--tests/testutils/runcli.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/testutils/runcli.py b/tests/testutils/runcli.py
index 1f6951abe..0c8e962c2 100644
--- a/tests/testutils/runcli.py
+++ b/tests/testutils/runcli.py
@@ -167,6 +167,23 @@ class Result():
def assert_shell_error(self, fail_message=''):
assert self.exit_code == 1, fail_message
+ # get_start_order()
+ #
+ # Gets the list of elements processed in a given queue, in the
+ # order of their first appearances in the session.
+ #
+ # Args:
+ # activity (str): The queue activity name (like 'fetch')
+ #
+ # Returns:
+ # (list): A list of element names in the order which they first appeared in the result
+ #
+ def get_start_order(self, activity):
+ results = re.findall(r'\[\s*{}:(\S+)\s*\]\s*START\s*.*\.log'.format(activity), self.stderr)
+ if results is None:
+ return []
+ return list(results)
+
# get_tracked_elements()
#
# Produces a list of element names on which tracking occurred