From 41f10ab3b19e92d0521522d523858d2a9ffe0b0d Mon Sep 17 00:00:00 2001 From: Yeoh Ee Peng Date: Thu, 4 Apr 2019 10:30:36 +0800 Subject: 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 Signed-off-by: Richard Purdie --- scripts/lib/resulttool/store.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'scripts/lib') 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 def store(args, logger): tempdir = tempfile.mkdtemp(prefix='testresults.') try: + configvars = resultutils.extra_configvars.copy() + if args.executed_by: + configvars['EXECUTED_BY'] = args.executed_by results = {} logger.info('Reading files from %s' % args.source) if resultutils.is_url(args.source) or os.path.isfile(args.source): - resultutils.append_resultsdata(results, args.source) + resultutils.append_resultsdata(results, args.source, configvars=configvars) else: for root, dirs, files in os.walk(args.source): for name in files: f = os.path.join(root, name) if name == "testresults.json": - resultutils.append_resultsdata(results, f) + resultutils.append_resultsdata(results, f, configvars=configvars) elif args.all: dst = f.replace(args.source, tempdir + "/") os.makedirs(os.path.dirname(dst), exist_ok=True) @@ -93,4 +96,6 @@ def register_commands(subparsers): help='include all files, not just testresults.json files') parser_build.add_argument('-e', '--allow-empty', action='store_true', help='don\'t error if no results to store are found') + parser_build.add_argument('-x', '--executed-by', default='', + help='add executed-by configuration to each result file') -- cgit v1.2.3-54-g00ecf