summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/buildperf
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2016-08-16 15:56:56 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-25 23:00:03 +0100
commit60059ff5b81d6ba9ba344161d51d1290559ac2df (patch)
tree49e6ff4663472cf3f8c6bcaad822c1eb358bbfce /meta/lib/oeqa/buildperf
parent759357a3bdbe75a3409b9e58979ab8b45d9b6ae8 (diff)
downloadopenembedded-core-contrib-60059ff5b81d6ba9ba344161d51d1290559ac2df.tar.gz
oe-build-perf-test: tag results committed to Git
Create a Git tag when committing results to a Git repository. This patch also implements --commit-results-tag command line option for controlling the tag name. The value is a format string where the following fields may be used: - {git_branch} - target branch being tested - {git_commit} - target commit being tested - {tester_host} - hostname of the tester machine Tagging can be disabled by giving an empty string to --commit-results-tag. The option has no effect if --commit-results is not defined. 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')
-rw-r--r--meta/lib/oeqa/buildperf/base.py11
1 files changed, 10 insertions, 1 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):
fobj.write(','.join(values) + '\n')
- def git_commit_results(self, repo_path, branch=None):
+ def git_commit_results(self, repo_path, branch=None, tag=None):
"""Commit results into a Git repository"""
repo = GitRepo(repo_path, is_topdir=True)
if not branch:
@@ -223,6 +223,15 @@ class BuildPerfTestResult(unittest.TextTestResult):
if repo.get_current_branch() == branch:
log.info("Updating %s HEAD to latest commit", repo_path)
repo.run_cmd('reset --hard')
+
+ # Create (annotated) tag
+ if tag:
+ # Replace keywords
+ tag = tag.format(git_branch=self.git_branch,
+ git_commit=self.git_commit,
+ tester_host=self.hostname)
+ repo.run_cmd(['tag', '-a', '-m', msg, tag, commit])
+
finally:
if os.path.exists(tmp_index):
os.unlink(tmp_index)