diff options
author | Yeoh Ee Peng <ee.peng.yeoh@intel.com> | 2019-03-12 13:05:28 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-03-26 15:38:23 +0000 |
commit | d41c0a34e740d88be6a95873add7fa63eff02ac1 (patch) | |
tree | 721a4f6292c86c7e289c4809cd9954688ba479b7 /scripts/lib/resulttool/report.py | |
parent | 10502961503e56d8c703bd442ee3071199e683ce (diff) | |
download | poky-d41c0a34e740d88be6a95873add7fa63eff02ac1.tar.gz |
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.
(From OE-Core rev: f2d6019f39a4037cf0914b1cfb3ccb3a03dacfc6)
Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/resulttool/report.py')
-rw-r--r-- | scripts/lib/resulttool/report.py | 16 |
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): | |||
107 | maxlen=maxlen) | 107 | maxlen=maxlen) |
108 | print(output) | 108 | print(output) |
109 | 109 | ||
110 | def view_test_report(self, logger, source_dir, tag): | 110 | def view_test_report(self, logger, source_dir, branch, commit, tag): |
111 | test_count_reports = [] | 111 | test_count_reports = [] |
112 | if tag: | 112 | if commit: |
113 | if tag: | ||
114 | logger.warning("Ignoring --tag as --commit was specified") | ||
115 | tag_name = "{branch}/{commit_number}-g{commit}/{tag_number}" | ||
116 | repo = GitRepo(source_dir) | ||
117 | revs = gitarchive.get_test_revs(logger, repo, tag_name, branch=branch) | ||
118 | rev_index = gitarchive.rev_find(revs, 'commit', commit) | ||
119 | testresults = resultutils.git_get_result(repo, revs[rev_index][2]) | ||
120 | elif tag: | ||
113 | repo = GitRepo(source_dir) | 121 | repo = GitRepo(source_dir) |
114 | testresults = resultutils.git_get_result(repo, [tag]) | 122 | testresults = resultutils.git_get_result(repo, [tag]) |
115 | else: | 123 | else: |
@@ -125,7 +133,7 @@ class ResultsTextReport(object): | |||
125 | 133 | ||
126 | def report(args, logger): | 134 | def report(args, logger): |
127 | report = ResultsTextReport() | 135 | report = ResultsTextReport() |
128 | report.view_test_report(logger, args.source_dir, args.tag) | 136 | report.view_test_report(logger, args.source_dir, args.branch, args.commit, args.tag) |
129 | return 0 | 137 | return 0 |
130 | 138 | ||
131 | def register_commands(subparsers): | 139 | def register_commands(subparsers): |
@@ -136,5 +144,7 @@ def register_commands(subparsers): | |||
136 | parser_build.set_defaults(func=report) | 144 | parser_build.set_defaults(func=report) |
137 | parser_build.add_argument('source_dir', | 145 | parser_build.add_argument('source_dir', |
138 | help='source file/directory that contain the test result files to summarise') | 146 | help='source file/directory that contain the test result files to summarise') |
147 | parser_build.add_argument('--branch', '-B', default='master', help="Branch to find commit in") | ||
148 | parser_build.add_argument('--commit', help="Revision to report") | ||
139 | parser_build.add_argument('-t', '--tag', default='', | 149 | parser_build.add_argument('-t', '--tag', default='', |
140 | help='source_dir is a git repository, report on the tag specified from that repository') | 150 | help='source_dir is a git repository, report on the tag specified from that repository') |