summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Sakoman <steve@sakoman.com>2020-05-22 12:38:18 -1000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-05-24 23:55:31 +0100
commit3d5aa170d2e88b852bd2a4452aab9311a24badef (patch)
tree4b06e005b2a379f73f1a4363255481320320b745
parent26090a2861ebe21224aaf89d7be0c0a89ca58e48 (diff)
downloadopenembedded-core-3d5aa170d2e88b852bd2a4452aab9311a24badef.tar.gz
openembedded-core-3d5aa170d2e88b852bd2a4452aab9311a24badef.tar.bz2
openembedded-core-3d5aa170d2e88b852bd2a4452aab9311a24badef.zip
oeqa/concurrencytest: don't delete build directory for failed tests
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.py10
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:
# a very basic TestResult proxy, in order to modify add* calls
def __init__(self, target):
self.result = target
+ self.failed_tests = 0
def _addResult(self, method, test, *args, exception = False, **kwargs):
return method(test, *args, **kwargs)
def addError(self, test, err = None, **kwargs):
+ self.failed_tests += 1
self._addResult(self.result.addError, test, err, exception = True, **kwargs)
def addFailure(self, test, err = None, **kwargs):
+ self.failed_tests += 1
self._addResult(self.result.addFailure, test, err, exception = True, **kwargs)
def addSuccess(self, test, **kwargs):
@@ -96,6 +99,9 @@ class ProxyTestResult:
def addUnexpectedSuccess(self, test, **kwargs):
self._addResult(self.result.addUnexpectedSuccess, test, **kwargs)
+ def wasSuccessful(self):
+ return self.failed_tests == 0
+
def __getattr__(self, attr):
return getattr(self.result, attr)
@@ -287,10 +293,10 @@ def fork_for_tests(concurrency_num, suite):
# as per default in parent code
subunit_client.buffer = True
subunit_result = AutoTimingTestResultDecorator(subunit_client)
- process_suite.run(ExtraResultsEncoderTestResult(subunit_result))
+ unittest_result = process_suite.run(ExtraResultsEncoderTestResult(subunit_result))
if ourpid != os.getpid():
os._exit(0)
- if newbuilddir:
+ if newbuilddir and unittest_result.wasSuccessful():
removebuilddir(newbuilddir)
except:
# Don't do anything with process children