[oe-commits] [openembedded-core] 03/35: oeqa/concurrenttest: Patch subunit module to handle classSetup failures
git at git.openembedded.org
git at git.openembedded.org
Fri Jun 7 12:58:12 UTC 2019
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch warrior
in repository openembedded-core.
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Thu May 9 14:35:03 2019 +0100
oeqa/concurrenttest: Patch subunit module to handle classSetup failures
Currently setupClass errors were not being mapped back to the failing tests
and they were hence being marked as UNKNOWN and the test statistics were
This is because whilst the errors were being encoded into the test results
stream, the decoder doesn't cope with an error outside a testStart event.
We patch in an addError handler to the outsideTest parser so that this
does get handled in a way similar to the non-concurrent case.
It would be nice if we didn't have to do this but there doesn't seem
to be any other way to fix this other than forking subunit.
We also make a minor change so another of our changes can cope with
tests without a start time.
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808 at gmail.com>
meta/lib/oeqa/core/utils/concurrencytest.py | 27 +++++++++++++++++++++++----
1 file changed, 23 insertions(+), 4 deletions(-)
diff --git a/meta/lib/oeqa/core/utils/concurrencytest.py b/meta/lib/oeqa/core/utils/concurrencytest.py
index e050818..df8d5d0 100644
@@ -19,6 +19,7 @@ import testtools
from queue import Queue
from itertools import cycle
@@ -51,10 +52,11 @@ class BBThreadsafeForwardingResult(ThreadsafeForwardingResult):
def _add_result_with_semaphore(self, method, test, *args, **kwargs):
- self.result.starttime[test.id()] = self._test_start.timestamp()
- totalprogress = sum(len(x) for x in self.result.threadprogress.values())
- self.result.progressinfo[test.id()] = "%s: %s/%s %s/%s (%ss) (%s)" % (
+ if self._test_start:
+ self.result.starttime[test.id()] = self._test_start.timestamp()
+ totalprogress = sum(len(x) for x in self.result.threadprogress.values())
+ self.result.progressinfo[test.id()] = "%s: %s/%s %s/%s (%ss) (%s)" % (
@@ -67,6 +69,23 @@ class BBThreadsafeForwardingResult(ThreadsafeForwardingResult):
super(BBThreadsafeForwardingResult, self)._add_result_with_semaphore(method, test, *args, **kwargs)
+# We have to patch subunit since it doesn't understand how to handle addError
+# outside of a running test case. This can happen if classSetUp() fails
+# for a class of tests. This unfortunately has horrible internal knowledge.
+def outSideTestaddError(self, offset, line):
+ """An 'error:' directive has been read."""
+ test_name = line[offset:-1].decode('utf8')
+ self.parser._current_test = subunit.RemotedTestCase(test_name)
+ self.parser.current_test_description = test_name
+ self.parser._state = self.parser._reading_error_details
+subunit._OutSideTest.addError = outSideTestaddError
# A dummy structure to add to io.StringIO so that the .buffer object
# is available and accepts writes. This allows unittest with buffer=True
# to interact ok with subunit which wants to access sys.stdout.buffer.
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits