summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorAlexis Lothoré <alexis.lothore@bootlin.com>2023-02-24 17:45:50 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-02-26 11:59:52 +0000
commite557cd92d674f6bddd190bbe2eed2c7885f00016 (patch)
tree611bf3c351c861b6d2acb7a7e823ddad7a6de27d /meta
parentd86cbd3d3d9d2565cd29abd5698243781623185e (diff)
downloadpoky-e557cd92d674f6bddd190bbe2eed2c7885f00016.tar.gz
scripts/oe-selftest: append metadata to tests results
Many stored results TEST_TYPE are set to "oeselftest", however all those tests are not run with the same sets of parameters, so those tests results may not be comparable. Attach relevant parameters as tests metadata to allow identifying tests configuration so we can compare tests only when they are run with the same parameters. (From OE-Core rev: 406ec0a87e80d1ee0dd1d246adfe9507c10450ff) Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oeqa/selftest/context.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/meta/lib/oeqa/selftest/context.py b/meta/lib/oeqa/selftest/context.py
index c7dd03ce37..ab13131f29 100644
--- a/meta/lib/oeqa/selftest/context.py
+++ b/meta/lib/oeqa/selftest/context.py
@@ -22,6 +22,17 @@ from oeqa.core.exception import OEQAPreRun, OEQATestNotFound
22 22
23from oeqa.utils.commands import runCmd, get_bb_vars, get_test_layer 23from oeqa.utils.commands import runCmd, get_bb_vars, get_test_layer
24 24
25OESELFTEST_METADATA=["run_all_tests", "run_tests", "skips", "machine", "select_tags", "exclude_tags"]
26
27def get_oeselftest_metadata(args):
28 result = {}
29 raw_args = vars(args)
30 for metadata in OESELFTEST_METADATA:
31 if metadata in raw_args:
32 result[metadata] = raw_args[metadata]
33
34 return result
35
25class NonConcurrentTestSuite(unittest.TestSuite): 36class NonConcurrentTestSuite(unittest.TestSuite):
26 def __init__(self, suite, processes, setupfunc, removefunc): 37 def __init__(self, suite, processes, setupfunc, removefunc):
27 super().__init__([suite]) 38 super().__init__([suite])
@@ -334,12 +345,14 @@ class OESelftestTestContextExecutor(OETestContextExecutor):
334 import platform 345 import platform
335 from oeqa.utils.metadata import metadata_from_bb 346 from oeqa.utils.metadata import metadata_from_bb
336 metadata = metadata_from_bb() 347 metadata = metadata_from_bb()
348 oeselftest_metadata = get_oeselftest_metadata(args)
337 configuration = {'TEST_TYPE': 'oeselftest', 349 configuration = {'TEST_TYPE': 'oeselftest',
338 'STARTTIME': args.test_start_time, 350 'STARTTIME': args.test_start_time,
339 'MACHINE': self.tc.td["MACHINE"], 351 'MACHINE': self.tc.td["MACHINE"],
340 'HOST_DISTRO': oe.lsb.distro_identifier().replace(' ', '-'), 352 'HOST_DISTRO': oe.lsb.distro_identifier().replace(' ', '-'),
341 'HOST_NAME': metadata['hostname'], 353 'HOST_NAME': metadata['hostname'],
342 'LAYERS': metadata['layers']} 354 'LAYERS': metadata['layers'],
355 'OESELFTEST_METADATA': oeselftest_metadata}
343 return configuration 356 return configuration
344 357
345 def get_result_id(self, configuration): 358 def get_result_id(self, configuration):