Skip to content

Commit 16dbc11

Browse files
gopiotrnashif
authored andcommitted
twister: fix skip marked as pass in json report
When some testcase is skip in their source code by ztest_test_skip() function in final json report it is marked as pass what is wrong. Due to the changes in this commit those skips can be marked properly. Fixes: zephyrproject-rtos#41440 Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
1 parent ce60a91 commit 16dbc11

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

scripts/pylib/twister/twisterlib.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3830,11 +3830,13 @@ def json_report(self, filename, append=False, version="NA"):
38303830
if rom_size:
38313831
testcase["rom_size"] = rom_size
38323832

3833-
if instance.results[k] in ["PASS"] or instance.status == 'passed':
3833+
if instance.results[k] in ["SKIP"] or instance.status == 'skipped':
3834+
testcase["status"] = "skipped"
3835+
testcase["reason"] = instance.reason
3836+
elif instance.results[k] in ["PASS"] or instance.status == 'passed':
38343837
testcase["status"] = "passed"
38353838
if instance.handler:
38363839
testcase["execution_time"] = handler_time
3837-
38383840
elif instance.results[k] in ['FAIL', 'BLOCK'] or instance.status in ["error", "failed", "timeout", "flash_error"]:
38393841
testcase["status"] = "failed"
38403842
testcase["reason"] = instance.reason
@@ -3845,9 +3847,6 @@ def json_report(self, filename, append=False, version="NA"):
38453847
testcase["device_log"] = self.process_log(device_log)
38463848
else:
38473849
testcase["build_log"] = self.process_log(build_log)
3848-
elif instance.status == 'skipped':
3849-
testcase["status"] = "skipped"
3850-
testcase["reason"] = instance.reason
38513850
testcases.append(testcase)
38523851

38533852
suites = [ {"testcases": testcases} ]

0 commit comments

Comments
 (0)