summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/sdk/cases/buildlzip.py
diff options
context:
space:
mode:
authorHongxu Jia <hongxu.jia@windriver.com>2018-11-09 00:36:20 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-11-14 11:14:39 +0000
commitd40767ac831cb3e20b43a87a47e772026f6d19f6 (patch)
tree666fc89a2d23c87b5902fd891a236e1fb2fb8a7b /meta/lib/oeqa/sdk/cases/buildlzip.py
parent6b7227b68a7ecdf20829e555440a9cfed14db176 (diff)
downloadpoky-d40767ac831cb3e20b43a87a47e772026f6d19f6.tar.gz
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 (From OE-Core rev: 4828a88556d59e4d06933164c2ebeb9361b7450e) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/sdk/cases/buildlzip.py')
-rw-r--r--meta/lib/oeqa/sdk/cases/buildlzip.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/meta/lib/oeqa/sdk/cases/buildlzip.py b/meta/lib/oeqa/sdk/cases/buildlzip.py
index b28cc3a595..9d137f30eb 100644
--- a/meta/lib/oeqa/sdk/cases/buildlzip.py
+++ b/meta/lib/oeqa/sdk/cases/buildlzip.py
@@ -15,6 +15,7 @@ class BuildLzipTest(OESDKTestCase):
15 self.tc.sdk_dir, self.td['DATETIME'], dl_dir=dl_dir) 15 self.tc.sdk_dir, self.td['DATETIME'], dl_dir=dl_dir)
16 self.project.download_archive() 16 self.project.download_archive()
17 17
18 def setUp(self):
18 machine = self.td.get("MACHINE") 19 machine = self.td.get("MACHINE")
19 20
20 if not (self.tc.hasHostPackage("packagegroup-cross-canadian-%s" % machine) or 21 if not (self.tc.hasHostPackage("packagegroup-cross-canadian-%s" % machine) or