oeqa/runtime/ptest: fix detection of failed tests
PATCH 1/1 oeqa/runtime/ptest: fix detection of failed tests
Since commit d6065f136f6d ("oeqa/logparser: Various misc cleanups"), 7b17274c30c6 in poky, the ptest OEQA is unable to detect failures in any of the test results.
The reason is that the test result string changed from 'fail' to 'FAILED', because the original mapping has been removed as part of that commit, but the code in here is still trying to match against the old string, resulting in no matches, i.e. everything is treated as successful, even if it shouldn't be.
Update the OEQA ptest test to actually work again and report failure if there was a failure.
Note that the ptest test is marked as @expectedfail, so even though this test now again starts to fail, the overall OEQA test result is not affected - but at least the overall OEQA test summary reflects the correct status again.
In other words:
RESULTS:
RESULTS - ping.PingTest.test_ping: PASSED (0.26s)
RESULTS - ptest.PtestRunnerTest.test_ptestrunner: PASSED (4.05s) RESULTS - ssh.SSHTest.test_ssh: PASSED (0.60s)
SUMMARY:
image-debug () - Ran 3 tests in 4.937s
correctly changes to:
RESULTS:
RESULTS - ping.PingTest.test_ping: PASSED (0.24s)
RESULTS - ssh.SSHTest.test_ssh: PASSED (0.56s)
RESULTS - ptest.PtestRunnerTest.test_ptestrunner: EXPECTEDFAIL (4.13s) SUMMARY:
image-debug () - Ran 3 tests in 4.937s
instead.
--- meta/lib/oeqa/runtime/cases/ptest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/lib/oeqa/runtime/cases/ptest.py +1 -1
@@ -68,7 +68,7 @@ class PtestRunnerTest(OERuntimeTestCase): failed_tests = {} for section in results: - failed_testcases = [ "_".join(test.translate(trans).split()) for test in results[section] if results[section][test] == 'fail' ] + failed_testcases = [ "_".join(test.translate(trans).split()) for test in results[section] if results[section][test] == 'FAILED' ] if failed_testcases: failed_tests[section] = failed_testcases
Signature · 1 line
2.23.0.rc1
PATCH v2 1/1 oeqa/runtime/ptest: fix detection of failed tests
Since commit d6065f136f6d ("oeqa/logparser: Various misc cleanups"), 7b17274c30c6 in poky, the ptest OEQA is unable to detect failures in any of the test results.
The reason is that the test result string changed from 'fail' to 'FAILED', because the original mapping has been removed as part of that commit, but the code in here is still trying to match against the old string, resulting in no matches, i.e. everything is treated as successful, even if it shouldn't be.
Update the OEQA ptest test to actually work again and report failure if there was a failure.
Note that the ptest test is marked as @expectedfail, so even though this test now again starts to fail, the overall OEQA test result is not affected - but at least the overall OEQA test summary reflects the correct status again.
In other words:
RESULTS:
RESULTS - ping.PingTest.test_ping: PASSED (0.26s) RESULTS - ptest.PtestRunnerTest.test_ptestrunner: PASSED (4.05s) RESULTS - ssh.SSHTest.test_ssh: PASSED (0.60s) SUMMARY:
image-debug () - Ran 3 tests in 4.937s
correctly changes to:
AssertionError: Failed ptests:
{'dummytest': ['check_True_is_True', 'test_basic']}
RESULTS:
RESULTS - ping.PingTest.test_ping: PASSED (0.24s)
RESULTS - ssh.SSHTest.test_ssh: PASSED (0.56s)
RESULTS - ptest.PtestRunnerTest.test_ptestrunner: EXPECTEDFAIL (4.13s) SUMMARY:
image-debug () - Ran 3 tests in 4.937s
instead and we see a summary of the ptest subtests that failed.
---
v2: update last sentence in commit message
--- meta/lib/oeqa/runtime/cases/ptest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/lib/oeqa/runtime/cases/ptest.py +1 -1
@@ -68,7 +68,7 @@ class PtestRunnerTest(OERuntimeTestCase): failed_tests = {} for section in results: - failed_testcases = [ "_".join(test.translate(trans).split()) for test in results[section] if results[section][test] == 'fail' ] + failed_testcases = [ "_".join(test.translate(trans).split()) for test in results[section] if results[section][test] == 'FAILED' ] if failed_testcases: failed_tests[section] = failed_testcases
Signature · 1 line
2.23.0.rc1