From 326ababfd620ae5ea29bf486b9d68ba3d60cad30 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Mon, 9 Jul 2018 15:20:34 +0000 Subject: oeqa: Add selftest parallelisation support This allows oe-selftest to take a -j option which specifies how much test parallelisation to use. Currently this is "module" based with each module being split and run in a separate build directory. Further splitting could be done but this seems a good compromise between test setup and parallelism. You need python-testtools and python-subunit installed to use this but only when the -j option is specified. See notes posted to the openedmbedded-architecture list for more details about the design choices here. Some of this functionality may make more sense in the oeqa core ultimately. Signed-off-by: Richard Purdie --- meta/lib/oeqa/core/context.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'meta/lib/oeqa/core/context.py') diff --git a/meta/lib/oeqa/core/context.py b/meta/lib/oeqa/core/context.py index 10481b44b6..8cdfbf834f 100644 --- a/meta/lib/oeqa/core/context.py +++ b/meta/lib/oeqa/core/context.py @@ -58,14 +58,20 @@ class OETestContext(object): modules_required, filters) self.suites = self.loader.discover() - def runTests(self, skips=[]): + def runTests(self, processes=None, skips=[]): self.runner = self.runnerClass(self, descriptions=False, verbosity=2, buffer=True) # Dinamically skip those tests specified though arguments self.skipTests(skips) self._run_start_time = time.time() - result = self.runner.run(self.suites) + if processes: + from oeqa.core.utils.concurrencytest import ConcurrentTestSuite + + concurrent_suite = ConcurrentTestSuite(self.suites, processes) + result = self.runner.run(concurrent_suite) + else: + result = self.runner.run(self.suites) self._run_end_time = time.time() return result -- cgit v1.2.3