diff options
| -rw-r--r-- | meta/lib/oeqa/buildperf/base.py | 19 | ||||
| -rwxr-xr-x | scripts/oe-build-perf-test | 2 |
2 files changed, 16 insertions, 5 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: |
diff --git a/scripts/oe-build-perf-test b/scripts/oe-build-perf-test index 1ed5bdbf5e..cd27584120 100755 --- a/scripts/oe-build-perf-test +++ b/scripts/oe-build-perf-test | |||
| @@ -140,7 +140,7 @@ def parse_args(argv): | |||
| 140 | default="{git_branch}", | 140 | default="{git_branch}", |
| 141 | help="Commit results to branch BRANCH.") | 141 | help="Commit results to branch BRANCH.") |
| 142 | parser.add_argument('--commit-results-tag', metavar='TAG', | 142 | parser.add_argument('--commit-results-tag', metavar='TAG', |
| 143 | default="{git_branch}/{git_commit}", | 143 | default="{git_branch}/{git_commit}/{tag_num}", |
| 144 | help="Tag results commit with TAG.") | 144 | help="Tag results commit with TAG.") |
| 145 | 145 | ||
| 146 | return parser.parse_args(argv) | 146 | return parser.parse_args(argv) |
