aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/core/context.py
AgeCommit message (Collapse)Author
2019-04-09oeqa: Default to buffer mode for testsRichard Purdie
Currently some tests run in buffer mode and some don't. Those that don't can corrupt stdout/stderr. Switch to using buffer mode everywhere so we're consistent. If there is useful output on stdout/stderr, it will be displayed if the test fails. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster808@gmail.com>
2018-12-06oeqa/runner: Simplify codeRichard Purdie
There doesn't appear to be any reason we need this _results indirection any more so remove it. (From OE-Core rev: b618261811c48ff3b98eab1b340a8cd09ef183c6) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-11context: Include a command line argument to run all except certain testsLeonardo Sandoval
A new command line argument (-R, which is the oposite of current -r) that allows to run all test cases except the ones indicated through the command line. Some command line examples: * Run all except the distro test case: $ oe-selftest -R distrodata * Run all except the archiver test case and a single bblayers unit test $ oe-selftest -R archiver bblayers.BitbakeLayers.test_bitbakelayers_add_remove [YOCTO #11847] Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-07-30oeqa/{core,selftest}: Add support to validate if a specified test case isn't ↵Aníbal Limón
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] Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-09oeqa: Change the order to logDetails and logSummaryAníbal Limón
Is better to log the summary at end to see in an easy way the actual result of the test run. [YOCTO #11622] Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-06-05scripts/oe-test: Move load_test_components to oeqa.utilsAníbal Limón
In order to maintain compatibility with oe-selftest, the load_test_components needs to be re-used, so the script executor needs to pass to only load components supported by certain script (oe-test, oe-selftest). Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
2017-05-30oeqa/core/context: Include a _pre_run methodLeonardo Sandoval
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>
2017-05-30oeqa/core/context: Omit docstring output on XMLResultLeonardo Sandoval
By default, the xml runner class prints out the docstring for every unit test but it order to keep the same format as the standard runner, avoid docstring output setting descriptions to False. Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-05-30oeqa/core/context: Use a default iterable modules objectLeonardo Sandoval
The OETestLoader.modules must be an iterable object, otherwise checking presence of specific modules with the 'in' operator fails with the following command/error: % oe-test core .. - core - INFO - Running bitbake -p Traceback (most recent call last): File "..poky2/scripts/oe-test", line 108, in <module> ret = main() File "..poky2/scripts/oe-test", line 93, in main results = args.func(logger, args) File "..poky2/meta/lib/oeqa/core/context.py", line 235, in run self.tc.loadTests(self.module_paths, **self.tc_kwargs['load']) File "..poky2/meta/lib/oeqa/core/context.py", line 53, in loadTests self.suites = self.loader.discover() File "..poky2/meta/lib/oeqa/core/loader.py", line 204, in discover pattern='*.py', top_level_dir=path) File "/usr/lib64/python3.4/unittest/loader.py", line 275, in discover tests = list(self._find_tests(start_dir, pattern)) File "/usr/lib64/python3.4/unittest/loader.py", line 339, in _find_tests yield self.loadTestsFromModule(module) File "..poky2/meta/lib/oeqa/core/loader.py", line 266, in loadTestsFromModule and module.__name__ in self.modules \ TypeError: argument of type 'NoneType' is not iterable Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-05-30oeqa/core/context: Raise exception when a manifest is specified but missingLeonardo Sandoval
Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-05-30oeqa/core: Add support for run tests by module, class and nameAníbal Limón
This will enable only run certain module tests and filter by class and test name. Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-05-30oeqa/core: Add list tests support in context and runnerAníbal Limón
A common operation is to list tests, currently only selftest support it, this changes enables this functionality into the core framework. Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-05-30oeqa/core: Move OETestContext.log{Summary, Details} into OETestResultAníbal Limón
Those methods are used to write in the log the results so it makes sense to have defined at OETestResult because is a format of the result itself. [YOCTO #11450] Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-05-30oeqa/core: Don't expose OEStreamLogger in OETestContextAníbal Limón
The OEStreamLogger class is used for redirect PyUnit output to a certain logger so there is not need to expose at level of OETestContext because only OETestRunner needs to know. [YOCTO #11450] Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-31oeqa/core/context.py: Add validation for run-tests optionAníbal Limón
The run-tests option is optional so if isn't specified set to None instead of crash on split(). Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23oeqa/core/context: Add option to select tests to runMariano Lopez
This add the option to select what tests to run in the <module>[.<class>[.<test>]] format. Currently it just support modules Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
2017-01-23oeqa/core/context: Add support of OETestContextExecutorAníbal Limón
The OETestContextExecutor class supports to use oe-test for run core test component also is a base class for the other test components (runtime, sdk, selftest). Te principal functionality is to support cmdline parsing and execution of OETestContext, the test components could extend the common options to provide specific ones. The common options between test components are test data file, output log and test cases path's to scan. Also it initializes the logger to be passed to the whole OEQA framework. [YOCTO #10230] Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
2017-01-23oeqa/core: Add loader, context and decorator modulesAníbal Limón
loader: Implements OETestLoader handling OETestDecorator and filtering support when load tests. The OETestLoader is responsible to set custom methods, attrs of the OEQA frameowork. [YOCTO #10231] [YOCTO #10317] [YOCTO #10353] decorator: Add base class OETestDecorator to provide a common way to define decorators to be used over OETestCase's, every decorator has a method to be called when loading tests and before test execution starts. Special decorators could be implemented for filter tests on loading phase. context: Provides HIGH level API for loadTests and runTests of certain test component (i.e. runtime, sdk, selftest). [YOCTO #10230] Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>