summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/buildperf
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:03:47 +0100
commitcaf6ad889cc4db9d4af33ee15381d0148374dd12 (patch)
treee7f0f18a19b9023005c6ac37cb1505b5eec6d2ec /meta/lib/oeqa/buildperf
parent06b2c75c7e56d520a57302e4cc9a622137a4ca74 (diff)
downloadpoky-caf6ad889cc4db9d4af33ee15381d0148374dd12.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. (From OE-Core rev: cf2aba16338a147f81802f48d2e24a96c7133548) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/buildperf')
-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):
226 226
227 # Create (annotated) tag 227 # Create (annotated) tag
228 if tag: 228 if tag:
229 # Replace keywords 229 # Find tags matching the pattern
230 tag = tag.format(git_branch=self.git_branch, 230 tag_keywords = dict(git_branch=self.git_branch,
231 git_commit=self.git_commit, 231 git_commit=self.git_commit,
232 tester_host=self.hostname) 232 tester_host=self.hostname,
233 tag_num='[0-9]{1,5}')
234 tag_re = re.compile(tag.format(**tag_keywords) + '$')
235 tag_keywords['tag_num'] = 0
236 for existing_tag in repo.run_cmd('tag').splitlines():
237 if tag_re.match(existing_tag):
238 tag_keywords['tag_num'] += 1
239
240 tag = tag.format(**tag_keywords)
241 msg = "Test run #{} of {}:{}\n".format(tag_keywords['tag_num'],
242 self.git_branch,
243 self.git_commit)
233 repo.run_cmd(['tag', '-a', '-m', msg, tag, commit]) 244 repo.run_cmd(['tag', '-a', '-m', msg, tag, commit])
234 245
235 finally: 246 finally: