diff options
author | Trevor Gamblin <trevor.gamblin@windriver.com> | 2020-02-18 09:56:18 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-02-18 23:53:55 +0000 |
commit | 450688b0104ee035813569156805584c4e50ac66 (patch) | |
tree | 15b08a93a1551e4d255bca667dcad249b3b265f4 /meta/lib | |
parent | 816dc2b5acde18eeba7edb7d0c4052bd0ce47cb8 (diff) | |
download | poky-450688b0104ee035813569156805584c4e50ac66.tar.gz |
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().
(From OE-Core rev: 9b8734b584d6e8d9c32ff2a721b29f3f3e61cca7)
Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oeqa/core/utils/concurrencytest.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/meta/lib/oeqa/core/utils/concurrencytest.py b/meta/lib/oeqa/core/utils/concurrencytest.py index 71ec0df5fa..0d9c01e6d4 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): | |||
146 | 146 | ||
147 | subunit._OutSideTest.addError = outSideTestaddError | 147 | subunit._OutSideTest.addError = outSideTestaddError |
148 | 148 | ||
149 | # Like outSideTestaddError above, we need an equivalent for skips | ||
150 | # happening at the setUpClass() level, otherwise we will see "UNKNOWN" | ||
151 | # as a result for concurrent tests | ||
152 | # | ||
153 | def outSideTestaddSkip(self, offset, line): | ||
154 | """A 'skip:' directive has been read.""" | ||
155 | test_name = line[offset:-1].decode('utf8') | ||
156 | self.parser._current_test = subunit.RemotedTestCase(test_name) | ||
157 | self.parser.current_test_description = test_name | ||
158 | self.parser._state = self.parser._reading_skip_details | ||
159 | self.parser._reading_skip_details.set_simple() | ||
160 | self.parser.subunitLineReceived(line) | ||
161 | |||
162 | subunit._OutSideTest.addSkip = outSideTestaddSkip | ||
149 | 163 | ||
150 | # | 164 | # |
151 | # A dummy structure to add to io.StringIO so that the .buffer object | 165 | # A dummy structure to add to io.StringIO so that the .buffer object |