summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>2017-05-26 15:37:53 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-02 13:36:14 +0100
commit60ade6074e8b1320f72c7d011b13bac9fa7f874e (patch)
tree9b8b8f5f00b04e657c27cb15c3e18aab1372371e
parent5e0efc99426d52580018274adfb1199898f3b863 (diff)
downloadpoky-60ade6074e8b1320f72c7d011b13bac9fa7f874e.tar.gz
oeqa/core/context: Include a _pre_run method
This pre runner will serve to allow Test components executes code previously of the run a suite. (From OE-Core rev: bafb7e221d40d7a87a02cec8a97d98eec7c23438) Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/core/context.py4
-rw-r--r--meta/lib/oeqa/core/exception.py3
-rwxr-xr-xscripts/oe-test3
3 files changed, 10 insertions, 0 deletions
diff --git a/meta/lib/oeqa/core/context.py b/meta/lib/oeqa/core/context.py
index 6667f46f1e..5f399fdfcc 100644
--- a/meta/lib/oeqa/core/context.py
+++ b/meta/lib/oeqa/core/context.py
@@ -143,6 +143,9 @@ class OETestContextExecutor(object):
143 143
144 self.module_paths = args.CASES_PATHS 144 self.module_paths = args.CASES_PATHS
145 145
146 def _pre_run(self):
147 pass
148
146 def run(self, logger, args): 149 def run(self, logger, args):
147 self._process_args(logger, args) 150 self._process_args(logger, args)
148 151
@@ -152,6 +155,7 @@ class OETestContextExecutor(object):
152 if args.list_tests: 155 if args.list_tests:
153 rc = self.tc.listTests(args.list_tests, **self.tc_kwargs['run']) 156 rc = self.tc.listTests(args.list_tests, **self.tc_kwargs['run'])
154 else: 157 else:
158 self._pre_run()
155 rc = self.tc.runTests(**self.tc_kwargs['run']) 159 rc = self.tc.runTests(**self.tc_kwargs['run'])
156 rc.logSummary(self.name) 160 rc.logSummary(self.name)
157 rc.logDetails() 161 rc.logDetails()
diff --git a/meta/lib/oeqa/core/exception.py b/meta/lib/oeqa/core/exception.py
index 97ef19dd77..a07961adc3 100644
--- a/meta/lib/oeqa/core/exception.py
+++ b/meta/lib/oeqa/core/exception.py
@@ -15,3 +15,6 @@ class OEQADependency(OEQAException):
15 15
16class OEQAMissingManifest(OEQAException): 16class OEQAMissingManifest(OEQAException):
17 pass 17 pass
18
19class OEQAPreRun(OEQAException):
20 pass
diff --git a/scripts/oe-test b/scripts/oe-test
index a1d282db33..f90d85b3da 100755
--- a/scripts/oe-test
+++ b/scripts/oe-test
@@ -26,6 +26,7 @@ except ImportError:
26 pass 26 pass
27 27
28from oeqa.core.context import OETestContextExecutor 28from oeqa.core.context import OETestContextExecutor
29from oeqa.core.exception import OEQAPreRun
29 30
30logger = scriptutils.logger_create('oe-test') 31logger = scriptutils.logger_create('oe-test')
31 32
@@ -92,6 +93,8 @@ def main():
92 ret = err.code 93 ret = err.code
93 except argparse_oe.ArgumentUsageError as ae: 94 except argparse_oe.ArgumentUsageError as ae:
94 parser.error_subcommand(ae.message, ae.subcommand) 95 parser.error_subcommand(ae.message, ae.subcommand)
96 except OEQAPreRun as pr:
97 ret = 1
95 98
96 return ret 99 return ret
97 100