[oe-commits] [openembedded-core] 01/03: concurrencytest.py: add outSideTestaddSkip for subunit

git at git.openembedded.org git at git.openembedded.org
Tue Feb 18 17:30:04 UTC 2020


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 94887b7f63ff878c3fb4012e48aa1118845483ea
Author: Trevor Gamblin <trevor.gamblin at windriver.com>
AuthorDate: Tue Feb 18 09:56:18 2020 -0500

    concurrencytest.py: add outSideTestaddSkip for subunit
    
    see: https://bugzilla.yoctoproject.org/show_bug.cgi?id=13663
    
    When running oe-selftest in concurrency mode (e.g. with oe-selftest
    --run-tests oescripts.OEPybootchartguyTests -j 4), if a skip occurred
    during setUpClass() rather than within individual tests, the entire
    suite would show "UNKNOWN" as each test's result. This is because
    subunit doesn't know how to handle skips outside of individual tests.
    An example of where this occurs is when running the above call to
    oe-selftest in concurrency mode on a host machine that does not have
    python3-cairo installed.
    
    Patch subunit inside concurrencytest.py to provide a method called
    outSideTestaddSkip, which will allow subunit to correctly detect the
    skip in setUpClass().
    
    Signed-off-by: Trevor Gamblin <trevor.gamblin at windriver.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/lib/oeqa/core/utils/concurrencytest.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/meta/lib/oeqa/core/utils/concurrencytest.py b/meta/lib/oeqa/core/utils/concurrencytest.py
index 71ec0df..0d9c01e 100644
--- a/meta/lib/oeqa/core/utils/concurrencytest.py
+++ b/meta/lib/oeqa/core/utils/concurrencytest.py
@@ -146,6 +146,20 @@ def outSideTestaddError(self, offset, line):
 
 subunit._OutSideTest.addError = outSideTestaddError
 
+# Like outSideTestaddError above, we need an equivalent for skips
+# happening at the setUpClass() level, otherwise we will see "UNKNOWN"
+# as a result for concurrent tests
+#
+def outSideTestaddSkip(self, offset, line):
+    """A 'skip:' 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_skip_details
+    self.parser._reading_skip_details.set_simple()
+    self.parser.subunitLineReceived(line)
+
+subunit._OutSideTest.addSkip = outSideTestaddSkip
 
 #
 # A dummy structure to add to io.StringIO so that the .buffer object

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list