diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-07-09 15:20:34 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-07-18 10:18:41 +0100 |
commit | ebd97e728ae1bd9442299c871a07a1b3b9f9efdf (patch) | |
tree | a76fec3b71434a64d9a9b8310434b78bceafdc89 /meta/lib/oeqa/core/context.py | |
parent | 05c32d2de1ee4681cc78cb107a158e9ab22c9619 (diff) | |
download | poky-ebd97e728ae1bd9442299c871a07a1b3b9f9efdf.tar.gz |
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.
(From OE-Core rev: 326ababfd620ae5ea29bf486b9d68ba3d60cad30)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/core/context.py')
-rw-r--r-- | meta/lib/oeqa/core/context.py | 10 |
1 files changed, 8 insertions, 2 deletions
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): | |||
58 | modules_required, filters) | 58 | modules_required, filters) |
59 | self.suites = self.loader.discover() | 59 | self.suites = self.loader.discover() |
60 | 60 | ||
61 | def runTests(self, skips=[]): | 61 | def runTests(self, processes=None, skips=[]): |
62 | self.runner = self.runnerClass(self, descriptions=False, verbosity=2, buffer=True) | 62 | self.runner = self.runnerClass(self, descriptions=False, verbosity=2, buffer=True) |
63 | 63 | ||
64 | # Dinamically skip those tests specified though arguments | 64 | # Dinamically skip those tests specified though arguments |
65 | self.skipTests(skips) | 65 | self.skipTests(skips) |
66 | 66 | ||
67 | self._run_start_time = time.time() | 67 | self._run_start_time = time.time() |
68 | result = self.runner.run(self.suites) | 68 | if processes: |
69 | from oeqa.core.utils.concurrencytest import ConcurrentTestSuite | ||
70 | |||
71 | concurrent_suite = ConcurrentTestSuite(self.suites, processes) | ||
72 | result = self.runner.run(concurrent_suite) | ||
73 | else: | ||
74 | result = self.runner.run(self.suites) | ||
69 | self._run_end_time = time.time() | 75 | self._run_end_time = time.time() |
70 | 76 | ||
71 | return result | 77 | return result |