From 80c1002c2e4dd7cdaa6ef40a5d37addcc27ca3da Mon Sep 17 00:00:00 2001 From: Stefan Kral Date: Thu, 26 Mar 2020 00:11:05 +0100 Subject: 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. (From OE-Core rev: e6c73ed8d3c5d45f387cab619ca73c21e850582f) Signed-off-by: Stefan Kral Signed-off-by: Richard Purdie --- meta/lib/oeqa/core/context.py | 10 ++++++---- meta/lib/oeqa/runtime/context.py | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'meta') 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 diff --git a/meta/lib/oeqa/runtime/context.py b/meta/lib/oeqa/runtime/context.py index 101434a595..3826f27642 100644 --- a/meta/lib/oeqa/runtime/context.py +++ b/meta/lib/oeqa/runtime/context.py @@ -47,6 +47,7 @@ class OERuntimeTestContextExecutor(OETestContextExecutor): default_data = None default_test_data = 'data/testdata.json' default_tests = '' + default_json_result_dir = '%s-results' % name default_target_type = 'simpleremote' default_manifest = 'data/manifest' -- cgit v1.2.3-54-g00ecf