]> code.ossystems Code Review - openembedded-core.git/commitdiff
oe-build-perf-test: implement --commit-results-branch
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Fri, 12 Aug 2016 11:11:16 +0000 (14:11 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 25 Aug 2016 22:00:00 +0000 (23:00 +0100)
A new command line option for defining the branch where results are
commited. The value is actually a format string accepting two field
names:
- {git_branch} expands to the name of the target branch being tested
- {tester_host} expands to the hostname of the tester machine

The option has no effect if --commit-results is not used.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/lib/oeqa/buildperf/base.py
scripts/oe-build-perf-test

index 8f7d88cd425db708865c052efda03e8663fe607a..119e6edf18737f022f836e5bf4ddb8943dac61c8 100644 (file)
@@ -193,6 +193,11 @@ class BuildPerfTestResult(unittest.TextTestResult):
         repo = GitRepo(repo_path, is_topdir=True)
         if not branch:
             branch = self.git_branch
+        else:
+            # Replace keywords
+            branch = branch.format(git_branch=self.git_branch,
+                                   tester_host=self.hostname)
+
         log.info("Committing test results into %s %s", repo_path, branch)
         tmp_index = os.path.join(repo_path, '.git', 'index.oe-build-perf')
         try:
index d6ea5ce685b124fbf32e490878c84b7692785660..390e4c9519bfdb707270bd15c9fc85b444e920f4 100755 (executable)
@@ -112,6 +112,9 @@ def parse_args(argv):
     parser.add_argument('--commit-results', metavar='GIT_DIR',
                         type=os.path.abspath,
                         help="Commit result data to a (local) git repository")
+    parser.add_argument('--commit-results-branch', metavar='BRANCH',
+                        default="{git_branch}",
+                        help="Commit results to branch BRANCH.")
 
     return parser.parse_args(argv)
 
@@ -162,7 +165,8 @@ def main(argv=None):
         if args.globalres_file:
             result.update_globalres_file(args.globalres_file)
         if args.commit_results:
-            result.git_commit_results(args.commit_results)
+            result.git_commit_results(args.commit_results,
+                                      args.commit_results_branch)
         return 0
 
     return 1