diff options
Diffstat (limited to 'meta/lib/oeqa/buildperf/base.py')
-rw-r--r-- | meta/lib/oeqa/buildperf/base.py | 19 |
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: |