summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/core/context.py
diff options
context:
space:
mode:
authorStefan Kral <sk@typedivision.de>2020-03-26 00:11:05 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-03-28 10:24:40 +0000
commite6c73ed8d3c5d45f387cab619ca73c21e850582f (patch)
tree6c757c0becf035755d2cc748a19ff01cac09066f /meta/lib/oeqa/core/context.py
parent3dd4e637c11abdd6341a3e0c6b67639d3d703862 (diff)
downloadopenembedded-core-contrib-e6c73ed8d3c5d45f387cab619ca73c21e850582f.tar.gz
oeqa: default runtime json results for testexport
Set the json result output dir in the oeqe runtime context to create testresults.json file by default for exported runtime test runs. Use current datetime for the json result property name (not DATETIME from build) to allow multiple result entries. Signed-off-by: Stefan Kral <sk@typedivision.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/core/context.py')
-rw-r--r--meta/lib/oeqa/core/context.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/meta/lib/oeqa/core/context.py b/meta/lib/oeqa/core/context.py
index b9a28ce319..4705d608ac 100644
--- a/meta/lib/oeqa/core/context.py
+++ b/meta/lib/oeqa/core/context.py
@@ -100,24 +100,26 @@ class OETestContextExecutor(object):
name = 'core'
help = 'core test component example'
description = 'executes core test suite example'
+ datetime = time.strftime("%Y%m%d%H%M%S")
default_cases = [os.path.join(os.path.abspath(os.path.dirname(__file__)),
'cases/example')]
default_test_data = os.path.join(default_cases[0], 'data.json')
default_tests = None
+ default_json_result_dir = None
def register_commands(self, logger, subparsers):
self.parser = subparsers.add_parser(self.name, help=self.help,
description=self.description, group='components')
- self.default_output_log = '%s-results-%s.log' % (self.name,
- time.strftime("%Y%m%d%H%M%S"))
+ self.default_output_log = '%s-results-%s.log' % (self.name, self.datetime)
self.parser.add_argument('--output-log', action='store',
default=self.default_output_log,
help="results output log, default: %s" % self.default_output_log)
self.parser.add_argument('--json-result-dir', action='store',
- help="json result output dir, create testresults.json here if set")
+ default=self.default_json_result_dir,
+ help="json result output dir, default: %s" % self.default_json_result_dir)
group = self.parser.add_mutually_exclusive_group()
group.add_argument('--run-tests', action='store', nargs='+',
@@ -195,7 +197,7 @@ class OETestContextExecutor(object):
def _get_result_id(self, configuration):
return '%s_%s_%s_%s' % (configuration['TEST_TYPE'], configuration['IMAGE_BASENAME'],
- configuration['MACHINE'], configuration['DATETIME'])
+ configuration['MACHINE'], self.datetime)
def _pre_run(self):
pass