diff options
author | Stefan Kral <sk@typedivision.de> | 2020-03-26 00:11:05 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-03-29 12:05:31 +0100 |
commit | 80c1002c2e4dd7cdaa6ef40a5d37addcc27ca3da (patch) | |
tree | 818b1aa0a2d50c473807b6d7a5404781f3f69357 /meta/lib/oeqa | |
parent | ef0c0868444b78e146ea7a65b02cc2f79c7b744d (diff) | |
download | poky-80c1002c2e4dd7cdaa6ef40a5d37addcc27ca3da.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.
(From OE-Core rev: e6c73ed8d3c5d45f387cab619ca73c21e850582f)
Signed-off-by: Stefan Kral <sk@typedivision.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r-- | meta/lib/oeqa/core/context.py | 10 | ||||
-rw-r--r-- | meta/lib/oeqa/runtime/context.py | 1 |
2 files changed, 7 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): | |||
100 | name = 'core' | 100 | name = 'core' |
101 | help = 'core test component example' | 101 | help = 'core test component example' |
102 | description = 'executes core test suite example' | 102 | description = 'executes core test suite example' |
103 | datetime = time.strftime("%Y%m%d%H%M%S") | ||
103 | 104 | ||
104 | default_cases = [os.path.join(os.path.abspath(os.path.dirname(__file__)), | 105 | default_cases = [os.path.join(os.path.abspath(os.path.dirname(__file__)), |
105 | 'cases/example')] | 106 | 'cases/example')] |
106 | default_test_data = os.path.join(default_cases[0], 'data.json') | 107 | default_test_data = os.path.join(default_cases[0], 'data.json') |
107 | default_tests = None | 108 | default_tests = None |
109 | default_json_result_dir = None | ||
108 | 110 | ||
109 | def register_commands(self, logger, subparsers): | 111 | def register_commands(self, logger, subparsers): |
110 | self.parser = subparsers.add_parser(self.name, help=self.help, | 112 | self.parser = subparsers.add_parser(self.name, help=self.help, |
111 | description=self.description, group='components') | 113 | description=self.description, group='components') |
112 | 114 | ||
113 | self.default_output_log = '%s-results-%s.log' % (self.name, | 115 | self.default_output_log = '%s-results-%s.log' % (self.name, self.datetime) |
114 | time.strftime("%Y%m%d%H%M%S")) | ||
115 | self.parser.add_argument('--output-log', action='store', | 116 | self.parser.add_argument('--output-log', action='store', |
116 | default=self.default_output_log, | 117 | default=self.default_output_log, |
117 | help="results output log, default: %s" % self.default_output_log) | 118 | help="results output log, default: %s" % self.default_output_log) |
118 | 119 | ||
119 | self.parser.add_argument('--json-result-dir', action='store', | 120 | self.parser.add_argument('--json-result-dir', action='store', |
120 | help="json result output dir, create testresults.json here if set") | 121 | default=self.default_json_result_dir, |
122 | help="json result output dir, default: %s" % self.default_json_result_dir) | ||
121 | 123 | ||
122 | group = self.parser.add_mutually_exclusive_group() | 124 | group = self.parser.add_mutually_exclusive_group() |
123 | group.add_argument('--run-tests', action='store', nargs='+', | 125 | group.add_argument('--run-tests', action='store', nargs='+', |
@@ -195,7 +197,7 @@ class OETestContextExecutor(object): | |||
195 | 197 | ||
196 | def _get_result_id(self, configuration): | 198 | def _get_result_id(self, configuration): |
197 | return '%s_%s_%s_%s' % (configuration['TEST_TYPE'], configuration['IMAGE_BASENAME'], | 199 | return '%s_%s_%s_%s' % (configuration['TEST_TYPE'], configuration['IMAGE_BASENAME'], |
198 | configuration['MACHINE'], configuration['DATETIME']) | 200 | configuration['MACHINE'], self.datetime) |
199 | 201 | ||
200 | def _pre_run(self): | 202 | def _pre_run(self): |
201 | pass | 203 | 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): | |||
47 | default_data = None | 47 | default_data = None |
48 | default_test_data = 'data/testdata.json' | 48 | default_test_data = 'data/testdata.json' |
49 | default_tests = '' | 49 | default_tests = '' |
50 | default_json_result_dir = '%s-results' % name | ||
50 | 51 | ||
51 | default_target_type = 'simpleremote' | 52 | default_target_type = 'simpleremote' |
52 | default_manifest = 'data/manifest' | 53 | default_manifest = 'data/manifest' |