summaryrefslogtreecommitdiffstats
path: root/scripts/lib/resulttool/merge.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/resulttool/merge.py')
-rw-r--r--scripts/lib/resulttool/merge.py20
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
11import resulttool.resultutils as resultutils 11import resulttool.resultutils as resultutils
12 12
13def merge(args, logger): 13def 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
26def register_commands(subparsers): 33def 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')