mirror of
https://git.yoctoproject.org/poky
synced 2026-01-29 21:08:42 +01:00
oeqa/{core,selftest}: Add support to validate if a specified test case isn't found
If some test module/case is specified to run and isn't found the OEQA framework didn't notice it, so complete the implementation using modules_required and validate for the test case prescense. Raise an exception when the test module/case required isn't found. [YOCTO #11645] (From OE-Core rev: e50b415aaaa1581473f85f0a8afa278b5f95129b) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
4c09b7a745
commit
2d50f153b5
@@ -10,7 +10,7 @@ import collections
|
||||
|
||||
from oeqa.core.loader import OETestLoader
|
||||
from oeqa.core.runner import OETestRunner
|
||||
from oeqa.core.exception import OEQAMissingManifest
|
||||
from oeqa.core.exception import OEQAMissingManifest, OEQATestNotFound
|
||||
|
||||
class OETestContext(object):
|
||||
loaderClass = OETestLoader
|
||||
@@ -139,6 +139,7 @@ class OETestContextExecutor(object):
|
||||
|
||||
if args.run_tests:
|
||||
self.tc_kwargs['load']['modules'] = args.run_tests
|
||||
self.tc_kwargs['load']['modules_required'] = args.run_tests
|
||||
else:
|
||||
self.tc_kwargs['load']['modules'] = []
|
||||
|
||||
@@ -151,7 +152,11 @@ class OETestContextExecutor(object):
|
||||
self._process_args(logger, args)
|
||||
|
||||
self.tc = self._context_class(**self.tc_kwargs['init'])
|
||||
self.tc.loadTests(self.module_paths, **self.tc_kwargs['load'])
|
||||
try:
|
||||
self.tc.loadTests(self.module_paths, **self.tc_kwargs['load'])
|
||||
except OEQATestNotFound as ex:
|
||||
logger.error(ex)
|
||||
sys.exit(1)
|
||||
|
||||
if args.list_tests:
|
||||
rc = self.tc.listTests(args.list_tests, **self.tc_kwargs['run'])
|
||||
|
||||
Reference in New Issue
Block a user