diff options
| -rw-r--r-- | meta/lib/oeqa/buildperf/base.py | 11 | ||||
| -rwxr-xr-x | scripts/oe-build-perf-test | 6 |
2 files changed, 15 insertions, 2 deletions
diff --git a/meta/lib/oeqa/buildperf/base.py b/meta/lib/oeqa/buildperf/base.py index 119e6edf18..a3cd3f3155 100644 --- a/meta/lib/oeqa/buildperf/base.py +++ b/meta/lib/oeqa/buildperf/base.py | |||
| @@ -188,7 +188,7 @@ class BuildPerfTestResult(unittest.TextTestResult): | |||
| 188 | fobj.write(','.join(values) + '\n') | 188 | fobj.write(','.join(values) + '\n') |
| 189 | 189 | ||
| 190 | 190 | ||
| 191 | def git_commit_results(self, repo_path, branch=None): | 191 | def git_commit_results(self, repo_path, branch=None, tag=None): |
| 192 | """Commit results into a Git repository""" | 192 | """Commit results into a Git repository""" |
| 193 | repo = GitRepo(repo_path, is_topdir=True) | 193 | repo = GitRepo(repo_path, is_topdir=True) |
| 194 | if not branch: | 194 | if not branch: |
| @@ -223,6 +223,15 @@ class BuildPerfTestResult(unittest.TextTestResult): | |||
| 223 | if repo.get_current_branch() == branch: | 223 | if repo.get_current_branch() == branch: |
| 224 | log.info("Updating %s HEAD to latest commit", repo_path) | 224 | log.info("Updating %s HEAD to latest commit", repo_path) |
| 225 | repo.run_cmd('reset --hard') | 225 | repo.run_cmd('reset --hard') |
| 226 | |||
| 227 | # Create (annotated) tag | ||
| 228 | if tag: | ||
| 229 | # Replace keywords | ||
| 230 | tag = tag.format(git_branch=self.git_branch, | ||
| 231 | git_commit=self.git_commit, | ||
| 232 | tester_host=self.hostname) | ||
| 233 | repo.run_cmd(['tag', '-a', '-m', msg, tag, commit]) | ||
| 234 | |||
| 226 | finally: | 235 | finally: |
| 227 | if os.path.exists(tmp_index): | 236 | if os.path.exists(tmp_index): |
| 228 | os.unlink(tmp_index) | 237 | os.unlink(tmp_index) |
diff --git a/scripts/oe-build-perf-test b/scripts/oe-build-perf-test index 437611c856..1ed5bdbf5e 100755 --- a/scripts/oe-build-perf-test +++ b/scripts/oe-build-perf-test | |||
| @@ -139,6 +139,9 @@ def parse_args(argv): | |||
| 139 | parser.add_argument('--commit-results-branch', metavar='BRANCH', | 139 | parser.add_argument('--commit-results-branch', metavar='BRANCH', |
| 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', | ||
| 143 | default="{git_branch}/{git_commit}", | ||
| 144 | help="Tag results commit with TAG.") | ||
| 142 | 145 | ||
| 143 | return parser.parse_args(argv) | 146 | return parser.parse_args(argv) |
| 144 | 147 | ||
| @@ -193,7 +196,8 @@ def main(argv=None): | |||
| 193 | result.update_globalres_file(args.globalres_file) | 196 | result.update_globalres_file(args.globalres_file) |
| 194 | if args.commit_results: | 197 | if args.commit_results: |
| 195 | result.git_commit_results(args.commit_results, | 198 | result.git_commit_results(args.commit_results, |
| 196 | args.commit_results_branch) | 199 | args.commit_results_branch, |
| 200 | args.commit_results_tag) | ||
| 197 | return 0 | 201 | return 0 |
| 198 | 202 | ||
| 199 | return 1 | 203 | return 1 |
