]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/core/context: Include a _pre_run method
authorLeonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Fri, 26 May 2017 20:37:53 +0000 (15:37 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 30 May 2017 09:15:22 +0000 (10:15 +0100)
This pre runner will serve to allow Test components executes code
previously of the run a suite.

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/core/context.py
meta/lib/oeqa/core/exception.py
scripts/oe-test

index 6667f46f1e2bb2b48a3b16bde07e5f51f259cd8d..5f399fdfccc98490983f1acb73ddc38630c740c6 100644 (file)
@@ -143,6 +143,9 @@ class OETestContextExecutor(object):
 
         self.module_paths = args.CASES_PATHS
 
+    def _pre_run(self):
+        pass
+
     def run(self, logger, args):
         self._process_args(logger, args)
 
@@ -152,6 +155,7 @@ class OETestContextExecutor(object):
         if args.list_tests:
             rc = self.tc.listTests(args.list_tests, **self.tc_kwargs['run'])
         else:
+            self._pre_run()
             rc = self.tc.runTests(**self.tc_kwargs['run'])
             rc.logSummary(self.name)
             rc.logDetails()
index 97ef19dd777549851c2631ff3cb536683f273d4e..a07961adc3194b2cc099250167186b15b03e8fb2 100644 (file)
@@ -15,3 +15,6 @@ class OEQADependency(OEQAException):
 
 class OEQAMissingManifest(OEQAException):
     pass
+
+class OEQAPreRun(OEQAException):
+    pass
index a1d282db3333eb73a8b97d37ced1e1dd6205eb56..f90d85b3dae93199060b3805caa766dc24020808 100755 (executable)
@@ -26,6 +26,7 @@ except ImportError:
     pass
 
 from oeqa.core.context import OETestContextExecutor
+from oeqa.core.exception import OEQAPreRun
 
 logger = scriptutils.logger_create('oe-test')
 
@@ -92,6 +93,8 @@ def main():
         ret = err.code
     except argparse_oe.ArgumentUsageError as ae:
         parser.error_subcommand(ae.message, ae.subcommand)
+    except OEQAPreRun as pr:
+        ret = 1
 
     return ret