diff options
author | Yeoh Ee Peng <ee.peng.yeoh@intel.com> | 2019-04-04 10:30:37 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-06-12 10:54:40 +0100 |
commit | 99c821eaaa78dc670c1f03a96f7bf83a541cde94 (patch) | |
tree | f3038b4cacf9d09831c6607031115e18f195d949 /scripts/lib | |
parent | 41f10ab3b19e92d0521522d523858d2a9ffe0b0d (diff) | |
download | poky-99c821eaaa78dc670c1f03a96f7bf83a541cde94.tar.gz |
resulttool/merge: Enable control TESTSERIES and extra configurations
Current QA team need to merge test result files from multiple sources.
Adding TESTSERIES configuration too early will have negative
implication to report and regression. Enable control to add TESTSERIES
when needed. Also enable adding EXECUTED_BY configuration when
needed.
(From OE-Core rev: 651d8d371e78e77599d56681228d5782664f7743)
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')
-rw-r--r-- | scripts/lib/resulttool/merge.py | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/scripts/lib/resulttool/merge.py b/scripts/lib/resulttool/merge.py index 70d23a48fd..18b4825a18 100644 --- a/scripts/lib/resulttool/merge.py +++ b/scripts/lib/resulttool/merge.py | |||
@@ -11,16 +11,23 @@ import json | |||
11 | import resulttool.resultutils as resultutils | 11 | import resulttool.resultutils as resultutils |
12 | 12 | ||
13 | def merge(args, logger): | 13 | def merge(args, logger): |
14 | configvars = {} | ||
15 | if not args.not_add_testseries: | ||
16 | configvars = resultutils.extra_configvars.copy() | ||
17 | if args.executed_by: | ||
18 | configvars['EXECUTED_BY'] = args.executed_by | ||
14 | if resultutils.is_url(args.target_results) or os.path.isdir(args.target_results): | 19 | if resultutils.is_url(args.target_results) or os.path.isdir(args.target_results): |
15 | results = resultutils.load_resultsdata(args.target_results, configmap=resultutils.store_map) | 20 | results = resultutils.load_resultsdata(args.target_results, configmap=resultutils.store_map, configvars=configvars) |
16 | resultutils.append_resultsdata(results, args.base_results, configmap=resultutils.store_map) | 21 | resultutils.append_resultsdata(results, args.base_results, configmap=resultutils.store_map, configvars=configvars) |
17 | resultutils.save_resultsdata(results, args.target_results) | 22 | resultutils.save_resultsdata(results, args.target_results) |
18 | else: | 23 | else: |
19 | results = resultutils.load_resultsdata(args.base_results, configmap=resultutils.flatten_map) | 24 | results = resultutils.load_resultsdata(args.base_results, configmap=resultutils.flatten_map, configvars=configvars) |
20 | if os.path.exists(args.target_results): | 25 | if os.path.exists(args.target_results): |
21 | resultutils.append_resultsdata(results, args.target_results, configmap=resultutils.flatten_map) | 26 | resultutils.append_resultsdata(results, args.target_results, configmap=resultutils.flatten_map, configvars=configvars) |
22 | resultutils.save_resultsdata(results, os.path.dirname(args.target_results), fn=os.path.basename(args.target_results)) | 27 | resultutils.save_resultsdata(results, os.path.dirname(args.target_results), fn=os.path.basename(args.target_results)) |
23 | 28 | ||
29 | logger.info('Merged results to %s' % os.path.dirname(args.target_results)) | ||
30 | |||
24 | return 0 | 31 | return 0 |
25 | 32 | ||
26 | def register_commands(subparsers): | 33 | def register_commands(subparsers): |
@@ -33,4 +40,7 @@ def register_commands(subparsers): | |||
33 | help='the results file/directory/URL to import') | 40 | help='the results file/directory/URL to import') |
34 | parser_build.add_argument('target_results', | 41 | parser_build.add_argument('target_results', |
35 | help='the target file or directory to merge the base_results with') | 42 | help='the target file or directory to merge the base_results with') |
36 | 43 | parser_build.add_argument('-t', '--not-add-testseries', action='store_true', | |
44 | help='do not add testseries configuration to results') | ||
45 | parser_build.add_argument('-x', '--executed-by', default='', | ||
46 | help='add executed-by configuration to each result file') | ||