summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYeoh Ee Peng <ee.peng.yeoh@intel.com>2019-03-12 13:05:28 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-03-25 23:12:07 +0000
commit8f23018bcb76c1b431f69183f993f08adb660fae (patch)
tree96403bc53bfbcfcf4ab8cffc1f0b3fd34081a5e1
parent514a9165790dda2afb412c519cb1444493dff1f9 (diff)
downloadopenembedded-core-contrib-8f23018bcb76c1b431f69183f993f08adb660fae.tar.gz
openembedded-core-contrib-8f23018bcb76c1b431f69183f993f08adb660fae.tar.bz2
openembedded-core-contrib-8f23018bcb76c1b431f69183f993f08adb660fae.zip
resulttool/report: Enable roll-up report for a commit
Enable roll-up all test results belong to a commit and to provide a roll-up report. Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--scripts/lib/resulttool/report.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/scripts/lib/resulttool/report.py b/scripts/lib/resulttool/report.py
index ff1b32c770..90086209e3 100644
--- a/scripts/lib/resulttool/report.py
+++ b/scripts/lib/resulttool/report.py
@@ -107,9 +107,17 @@ class ResultsTextReport(object):
maxlen=maxlen)
print(output)
- def view_test_report(self, logger, source_dir, tag):
+ def view_test_report(self, logger, source_dir, branch, commit, tag):
test_count_reports = []
- if tag:
+ if commit:
+ if tag:
+ logger.warning("Ignoring --tag as --commit was specified")
+ tag_name = "{branch}/{commit_number}-g{commit}/{tag_number}"
+ repo = GitRepo(source_dir)
+ revs = gitarchive.get_test_revs(logger, repo, tag_name, branch=branch)
+ rev_index = gitarchive.rev_find(revs, 'commit', commit)
+ testresults = resultutils.git_get_result(repo, revs[rev_index][2])
+ elif tag:
repo = GitRepo(source_dir)
testresults = resultutils.git_get_result(repo, [tag])
else:
@@ -125,7 +133,7 @@ class ResultsTextReport(object):
def report(args, logger):
report = ResultsTextReport()
- report.view_test_report(logger, args.source_dir, args.tag)
+ report.view_test_report(logger, args.source_dir, args.branch, args.commit, args.tag)
return 0
def register_commands(subparsers):
@@ -136,5 +144,7 @@ def register_commands(subparsers):
parser_build.set_defaults(func=report)
parser_build.add_argument('source_dir',
help='source file/directory that contain the test result files to summarise')
+ parser_build.add_argument('--branch', '-B', default='master', help="Branch to find commit in")
+ parser_build.add_argument('--commit', help="Revision to report")
parser_build.add_argument('-t', '--tag', default='',
help='source_dir is a git repository, report on the tag specified from that repository')