Skip to content

Commit 7e1cd18

Browse files
golowanowdkalowsk
authored andcommitted
twister: Fix NOTRUN status
Fix Twister TestCase statuses left not assigned ('NONE') in these 'NOTRUN' situations: * a test suite has `integration platform` which is not available to run. * `--cmake-only` execution. Signed-off-by: Dmitrii Golovanov <[email protected]>
1 parent d4b7bf9 commit 7e1cd18

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

scripts/pylib/twister/twisterlib/runner.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,9 @@ def process(self, pipeline, done, message, lock, results):
900900
next_op = 'report'
901901
elif self.options.cmake_only:
902902
if self.instance.status == TwisterStatus.NONE:
903-
self.instance.status = TwisterStatus.PASS
903+
logger.debug("CMake only: PASS %s" % self.instance.name)
904+
self.instance.status = TwisterStatus.NOTRUN
905+
self.instance.add_missing_case_status(TwisterStatus.NOTRUN, 'CMake only')
904906
next_op = 'report'
905907
else:
906908
# Here we check the runtime filter results coming from running cmake
@@ -974,6 +976,10 @@ def process(self, pipeline, done, message, lock, results):
974976
elif self.instance.run and self.instance.handler.ready:
975977
next_op = 'run'
976978
else:
979+
if self.instance.status == TwisterStatus.NOTRUN:
980+
run_conditions = f"(run:{self.instance.run}, handler.ready:{self.instance.handler.ready})"
981+
logger.debug(f"Instance {self.instance.name} can't run {run_conditions}")
982+
self.instance.add_missing_case_status(TwisterStatus.NOTRUN, f"Nowhere to run")
977983
next_op = 'report'
978984
except StatusAttributeError as sae:
979985
logger.error(str(sae))

scripts/tests/twister/test_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,7 @@ def mock_getsize(filename, *args, **kwargs):
978978
mock.ANY,
979979
[],
980980
{'op': 'report', 'test': mock.ANY},
981-
TwisterStatus.PASS,
981+
TwisterStatus.NOTRUN,
982982
mock.ANY,
983983
0,
984984
None

scripts/tests/twister_blackbox/test_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class TestRunner:
7373
os.path.join(TEST_DATA, 'tests', 'dummy', 'agnostic'),
7474
['qemu_x86', 'qemu_x86_64'],
7575
{
76-
'passed_configurations': 6,
76+
'passed_configurations': 0,
7777
'selected_test_instances': 6,
7878
'executed_on_platform': 0,
7979
'only_built': 6,

0 commit comments

Comments
 (0)