]> code.ossystems Code Review - openembedded-core.git/commit
testsdk: fix skipped testcase output "UNKNOWN" status while multiprocess execution
authorHongxu Jia <hongxu.jia@windriver.com>
Fri, 9 Nov 2018 08:36:20 +0000 (00:36 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 13 Nov 2018 15:18:28 +0000 (15:18 +0000)
commit4828a88556d59e4d06933164c2ebeb9361b7450e
tree20a0e8c4c411214b307f86d4e15ee37af4d16d12
parentfe871d23c2714e66a1f5e2428a16e742ca40fc62
testsdk: fix skipped testcase output "UNKNOWN" status while multiprocess execution

Usually skipped testcase output "SKIPPED"
[snip serial execution]
|RESULTS - buildgalculator.GalculatorTest.test_galculator - Testcase -1: SKIPPED (0.01s)
|RESULTS - python.PythonTest.test_python3 - Testcase -1: SKIPPED (0.01s)
[snip serial execution]

But if enable multiprocess execution, skipped testcase output "UNKNOWN" status
[snip enable multiprocess execution]
|RESULTS - buildgalculator.GalculatorTest.test_galculator - Testcase -1: UNKNOWN
|RESULTS - python.PythonTest.test_python3 - Testcase -1: UNKNOWN
[snip enable multiprocess execution]

Here is my investigation:

There is a class pairs TestProtocolClient and TestProtocolServer
provided by python3-subunit. The TestProtocolClient generates a
subunit stream of TestResult from a test run, and TestProtocolServer
parses the stream of subunit TestResult.

The class ProtocolTestCase is a unittest.TestCase adapter and it
uses TestProtocolServer to parse the stream of subunit TestResult.

In Yocto testsdk, it forks multiple processes to execute testcases
and use TestProtocolClient to generate TestResult stream; and then
it creates multiple threads to use ProtocolTestCase to parse stream
of subunit TestResult through pipe; finally it passes multiple
ProtocolTestCase as TestCase instance to main process and output
status result.

The problem point is TestProtocolServer parses `skip:' directive
after reading a `test:' directive. Without `test:' directive,
`skip:' directive will be ignored. All above requires SkipTest should
be raised inside a test method rather than setUpClass method.

Throwing SkipTest inside setUp works correctly

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/sdk/cases/assimp.py
meta/lib/oeqa/sdk/cases/buildcpio.py
meta/lib/oeqa/sdk/cases/buildgalculator.py
meta/lib/oeqa/sdk/cases/buildlzip.py
meta/lib/oeqa/sdk/cases/perl.py
meta/lib/oeqa/sdk/cases/python.py