aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/buildperf/base.py
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2016-08-23 16:41:53 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-25 23:00:04 +0100
commitcf2aba16338a147f81802f48d2e24a96c7133548 (patch)
treeababe52a34e81d7e28bdc48797b4eb6c8dd87346 /meta/lib/oeqa/buildperf/base.py
parent60059ff5b81d6ba9ba344161d51d1290559ac2df (diff)
downloadopenembedded-core-contrib-cf2aba16338a147f81802f48d2e24a96c7133548.tar.gz
oe-build-perf-test: new {tag_num} keyword for --commit-results-tag
This makes it possible to create numbered tags, where the "basename" of the tag is the same and the only difference is an (automatically) increasing index number. This is useful if you do multiple test runs on the same commit. For example, using: --commit-results-tag {tester_host}/{git_commit}/{tag_num} would give you tags something like: myhost/decb3119dffd3fd38b800bebc1e510f9217a152e/0 myhost/decb3119dffd3fd38b800bebc1e510f9217a152e/1 ... The default tag format is updated to use this new keyword in order to prevent unintentional tag name clashes. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/lib/oeqa/buildperf/base.py')
-rw-r--r--meta/lib/oeqa/buildperf/base.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/meta/lib/oeqa/buildperf/base.py b/meta/lib/oeqa/buildperf/base.py
index a3cd3f3155..faa30c72ec 100644
--- a/meta/lib/oeqa/buildperf/base.py
+++ b/meta/lib/oeqa/buildperf/base.py
@@ -226,10 +226,21 @@ class BuildPerfTestResult(unittest.TextTestResult):
# Create (annotated) tag
if tag:
- # Replace keywords
- tag = tag.format(git_branch=self.git_branch,
- git_commit=self.git_commit,
- tester_host=self.hostname)
+ # Find tags matching the pattern
+ tag_keywords = dict(git_branch=self.git_branch,
+ git_commit=self.git_commit,
+ tester_host=self.hostname,
+ tag_num='[0-9]{1,5}')
+ tag_re = re.compile(tag.format(**tag_keywords) + '$')
+ tag_keywords['tag_num'] = 0
+ for existing_tag in repo.run_cmd('tag').splitlines():
+ if tag_re.match(existing_tag):
+ tag_keywords['tag_num'] += 1
+
+ tag = tag.format(**tag_keywords)
+ msg = "Test run #{} of {}:{}\n".format(tag_keywords['tag_num'],
+ self.git_branch,
+ self.git_commit)
repo.run_cmd(['tag', '-a', '-m', msg, tag, commit])
finally: