[oe-commits] [openembedded-core] 32/50: oe-build-perf-test: implement --commit-results-branch

git at git.openembedded.org git at git.openembedded.org
Thu Aug 25 22:04:48 UTC 2016


rpurdie pushed a commit to branch master
in repository openembedded-core.

commit b54b63395ec632748a57a702812c8a9a07af35ab
Author: Markus Lehtonen <markus.lehtonen at linux.intel.com>
AuthorDate: Fri Aug 12 14:11:16 2016 +0300

    oe-build-perf-test: implement --commit-results-branch
    
    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 at linux.intel.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/lib/oeqa/buildperf/base.py | 5 +++++
 scripts/oe-build-perf-test      | 6 +++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oeqa/buildperf/base.py b/meta/lib/oeqa/buildperf/base.py
index 8f7d88c..119e6ed 100644
--- a/meta/lib/oeqa/buildperf/base.py
+++ b/meta/lib/oeqa/buildperf/base.py
@@ -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:
diff --git a/scripts/oe-build-perf-test b/scripts/oe-build-perf-test
index d6ea5ce..390e4c9 100755
--- a/scripts/oe-build-perf-test
+++ b/scripts/oe-build-perf-test
@@ -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

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list