mirror of
https://git.yoctoproject.org/poky
synced 2026-06-15 05:40:00 +00:00
1974a68926
Most of the text include on this text refactor came from [1]. [1] http://lists.openembedded.org/pipermail/openembedded-architecture/2016-December/000351.html (From OE-Core rev: 77635ffa3b621add9894ed247dafe146f4af1e84) Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
78 lines
2.5 KiB
Plaintext
78 lines
2.5 KiB
Plaintext
= OEQA (v2) Framework =
|
|
|
|
== Introduction ==
|
|
|
|
This is the new (version 2) OEQA framework. Base clases are located inside the
|
|
'oeqa/core' folder and subsequent components needs to extend from these.
|
|
|
|
The main design consideration was to implement the needed functionality
|
|
on top of Python unittest framework. To archive the latter, the following
|
|
modules are present:
|
|
|
|
* oeqa/core/runner.py: Provides OETestResult and OETestRunner base
|
|
classes extending the unittest ones. This class has the support for
|
|
export results to different formats currently RAW and XML.
|
|
|
|
* oeqa/core/loader.py: Provides OETestLoader extending unittest ones,
|
|
also implements unified way for decorator support and for filtering test
|
|
cases.
|
|
|
|
* oeqa/core/case.py: Provides OETestCase base class extending
|
|
unittest.TestCase and provides access to the Test data (td), Test context
|
|
and Logger functionality.
|
|
|
|
* oeqa/core/decorator: Provides OETestDecorator a new class to implement
|
|
decorators for Test cases.
|
|
|
|
* oeqa/core/context: Provides OETestContext a high-level API for
|
|
loadTests and runTests of certain Test component and
|
|
OETestContextExecutor a base class to enable oe-test to discover/use
|
|
the Test component.
|
|
|
|
In the other hand, a new 'oe-test' runner is located under 'scripts', allowing scans for components
|
|
that supports OETestContextExecutor (see below).
|
|
|
|
== Terminology ==
|
|
|
|
* Test component: The area of testing in the Project, for example: runtime, SDK, eSDK, selftest.
|
|
|
|
* Test data: Data associated with the Test component. Currently we use bitbake datastore as
|
|
a Test data input.
|
|
|
|
* Test context: A context of what tests needs to be run and how to do it, additionally provides
|
|
access to the Test data and could have custom methods, attrs.
|
|
|
|
== oe-test ==
|
|
|
|
The new tool oe-test (located at scripts) has the ability to scan the code base for test
|
|
components and provide a unified way to run test cases. Internally it scans folders inside
|
|
oeqa module in order to find specific classes that
|
|
implements a test component.
|
|
|
|
== Usage ==
|
|
|
|
Executing the example test component
|
|
|
|
$ source oe-init-build-env
|
|
$ oe-test core
|
|
|
|
Getting help
|
|
|
|
$ oe-test -h
|
|
|
|
== Creating new Test Component ==
|
|
|
|
Adding a new test component the developer needs to extend OETestContext/OETestContextExecutor
|
|
(from context.py) and OETestCase (from case.py)
|
|
|
|
== Selftesting the framework ==
|
|
|
|
Run all tests:
|
|
|
|
$ PATH=$PATH:../../ python3 -m unittest discover -s tests
|
|
|
|
Run some test:
|
|
|
|
$ cd tests/
|
|
$ ./test_data.py
|