diff options
author | Steve Sakoman <steve@sakoman.com> | 2020-05-22 12:38:18 -1000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-05-24 23:56:03 +0100 |
commit | 6b3b5ab4ba74030db65906abd89491fce44c0f12 (patch) | |
tree | 4d0a14634565fd4b7e23f3ac29e0e947f44e4b40 | |
parent | 57daea00de5676315c99c6791f6dfbd6957989d3 (diff) | |
download | poky-6b3b5ab4ba74030db65906abd89491fce44c0f12.tar.gz |
oeqa/concurrencytest: don't delete build directory for failed tests
(From OE-Core rev: 3d5aa170d2e88b852bd2a4452aab9311a24badef)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/core/utils/concurrencytest.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/meta/lib/oeqa/core/utils/concurrencytest.py b/meta/lib/oeqa/core/utils/concurrencytest.py index fac59f765a..01c39830f9 100644 --- a/meta/lib/oeqa/core/utils/concurrencytest.py +++ b/meta/lib/oeqa/core/utils/concurrencytest.py | |||
@@ -77,14 +77,17 @@ class ProxyTestResult: | |||
77 | # a very basic TestResult proxy, in order to modify add* calls | 77 | # a very basic TestResult proxy, in order to modify add* calls |
78 | def __init__(self, target): | 78 | def __init__(self, target): |
79 | self.result = target | 79 | self.result = target |
80 | self.failed_tests = 0 | ||
80 | 81 | ||
81 | def _addResult(self, method, test, *args, exception = False, **kwargs): | 82 | def _addResult(self, method, test, *args, exception = False, **kwargs): |
82 | return method(test, *args, **kwargs) | 83 | return method(test, *args, **kwargs) |
83 | 84 | ||
84 | def addError(self, test, err = None, **kwargs): | 85 | def addError(self, test, err = None, **kwargs): |
86 | self.failed_tests += 1 | ||
85 | self._addResult(self.result.addError, test, err, exception = True, **kwargs) | 87 | self._addResult(self.result.addError, test, err, exception = True, **kwargs) |
86 | 88 | ||
87 | def addFailure(self, test, err = None, **kwargs): | 89 | def addFailure(self, test, err = None, **kwargs): |
90 | self.failed_tests += 1 | ||
88 | self._addResult(self.result.addFailure, test, err, exception = True, **kwargs) | 91 | self._addResult(self.result.addFailure, test, err, exception = True, **kwargs) |
89 | 92 | ||
90 | def addSuccess(self, test, **kwargs): | 93 | def addSuccess(self, test, **kwargs): |
@@ -96,6 +99,9 @@ class ProxyTestResult: | |||
96 | def addUnexpectedSuccess(self, test, **kwargs): | 99 | def addUnexpectedSuccess(self, test, **kwargs): |
97 | self._addResult(self.result.addUnexpectedSuccess, test, **kwargs) | 100 | self._addResult(self.result.addUnexpectedSuccess, test, **kwargs) |
98 | 101 | ||
102 | def wasSuccessful(self): | ||
103 | return self.failed_tests == 0 | ||
104 | |||
99 | def __getattr__(self, attr): | 105 | def __getattr__(self, attr): |
100 | return getattr(self.result, attr) | 106 | return getattr(self.result, attr) |
101 | 107 | ||
@@ -287,10 +293,10 @@ def fork_for_tests(concurrency_num, suite): | |||
287 | # as per default in parent code | 293 | # as per default in parent code |
288 | subunit_client.buffer = True | 294 | subunit_client.buffer = True |
289 | subunit_result = AutoTimingTestResultDecorator(subunit_client) | 295 | subunit_result = AutoTimingTestResultDecorator(subunit_client) |
290 | process_suite.run(ExtraResultsEncoderTestResult(subunit_result)) | 296 | unittest_result = process_suite.run(ExtraResultsEncoderTestResult(subunit_result)) |
291 | if ourpid != os.getpid(): | 297 | if ourpid != os.getpid(): |
292 | os._exit(0) | 298 | os._exit(0) |
293 | if newbuilddir: | 299 | if newbuilddir and unittest_result.wasSuccessful(): |
294 | removebuilddir(newbuilddir) | 300 | removebuilddir(newbuilddir) |
295 | except: | 301 | except: |
296 | # Don't do anything with process children | 302 | # Don't do anything with process children |