summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
authorYeoh Ee Peng <ee.peng.yeoh@intel.com>2019-04-04 10:30:36 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-06-12 10:54:40 +0100
commit41f10ab3b19e92d0521522d523858d2a9ffe0b0d (patch)
tree6bc707ac07359f2e084100239e8841a2d2e61926 /scripts/lib
parent588f4550824241aae61930bb732f56c6a3b51a9f (diff)
downloadpoky-41f10ab3b19e92d0521522d523858d2a9ffe0b0d.tar.gz
resulttool/store: Enable add EXECUTED_BY config to results
Current results stored does not have information needed to trace who executed the tests. Enable store to add EXECUTED_BY configuration to results file in order to track who executed the tests. (From OE-Core rev: dca2a57d54163a2e63b06e2f140fea3bd49cef0d) 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/store.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/lib/resulttool/store.py b/scripts/lib/resulttool/store.py
index 06505aecc0..79c83dd8b7 100644
--- a/scripts/lib/resulttool/store.py
+++ b/scripts/lib/resulttool/store.py
@@ -21,16 +21,19 @@ import oeqa.utils.gitarchive as gitarchive
21def store(args, logger): 21def store(args, logger):
22 tempdir = tempfile.mkdtemp(prefix='testresults.') 22 tempdir = tempfile.mkdtemp(prefix='testresults.')
23 try: 23 try:
24 configvars = resultutils.extra_configvars.copy()
25 if args.executed_by:
26 configvars['EXECUTED_BY'] = args.executed_by
24 results = {} 27 results = {}
25 logger.info('Reading files from %s' % args.source) 28 logger.info('Reading files from %s' % args.source)
26 if resultutils.is_url(args.source) or os.path.isfile(args.source): 29 if resultutils.is_url(args.source) or os.path.isfile(args.source):
27 resultutils.append_resultsdata(results, args.source) 30 resultutils.append_resultsdata(results, args.source, configvars=configvars)
28 else: 31 else:
29 for root, dirs, files in os.walk(args.source): 32 for root, dirs, files in os.walk(args.source):
30 for name in files: 33 for name in files:
31 f = os.path.join(root, name) 34 f = os.path.join(root, name)
32 if name == "testresults.json": 35 if name == "testresults.json":
33 resultutils.append_resultsdata(results, f) 36 resultutils.append_resultsdata(results, f, configvars=configvars)
34 elif args.all: 37 elif args.all:
35 dst = f.replace(args.source, tempdir + "/") 38 dst = f.replace(args.source, tempdir + "/")
36 os.makedirs(os.path.dirname(dst), exist_ok=True) 39 os.makedirs(os.path.dirname(dst), exist_ok=True)
@@ -93,4 +96,6 @@ def register_commands(subparsers):
93 help='include all files, not just testresults.json files') 96 help='include all files, not just testresults.json files')
94 parser_build.add_argument('-e', '--allow-empty', action='store_true', 97 parser_build.add_argument('-e', '--allow-empty', action='store_true',
95 help='don\'t error if no results to store are found') 98 help='don\'t error if no results to store are found')
99 parser_build.add_argument('-x', '--executed-by', default='',
100 help='add executed-by configuration to each result file')
96 101