mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 21:09:03 +02:00
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>
This commit is contained in:
parent
588f455082
commit
41f10ab3b1
|
@ -21,16 +21,19 @@ import oeqa.utils.gitarchive as gitarchive
|
||||||
def store(args, logger):
|
def store(args, logger):
|
||||||
tempdir = tempfile.mkdtemp(prefix='testresults.')
|
tempdir = tempfile.mkdtemp(prefix='testresults.')
|
||||||
try:
|
try:
|
||||||
|
configvars = resultutils.extra_configvars.copy()
|
||||||
|
if args.executed_by:
|
||||||
|
configvars['EXECUTED_BY'] = args.executed_by
|
||||||
results = {}
|
results = {}
|
||||||
logger.info('Reading files from %s' % args.source)
|
logger.info('Reading files from %s' % args.source)
|
||||||
if resultutils.is_url(args.source) or os.path.isfile(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:
|
else:
|
||||||
for root, dirs, files in os.walk(args.source):
|
for root, dirs, files in os.walk(args.source):
|
||||||
for name in files:
|
for name in files:
|
||||||
f = os.path.join(root, name)
|
f = os.path.join(root, name)
|
||||||
if name == "testresults.json":
|
if name == "testresults.json":
|
||||||
resultutils.append_resultsdata(results, f)
|
resultutils.append_resultsdata(results, f, configvars=configvars)
|
||||||
elif args.all:
|
elif args.all:
|
||||||
dst = f.replace(args.source, tempdir + "/")
|
dst = f.replace(args.source, tempdir + "/")
|
||||||
os.makedirs(os.path.dirname(dst), exist_ok=True)
|
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')
|
help='include all files, not just testresults.json files')
|
||||||
parser_build.add_argument('-e', '--allow-empty', action='store_true',
|
parser_build.add_argument('-e', '--allow-empty', action='store_true',
|
||||||
help='don\'t error if no results to store are found')
|
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')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user