summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorLeonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>2017-05-26 15:37:48 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-02 13:36:14 +0100
commit1974a68926064a7abebedae44658c19d98548730 (patch)
treed482974492f65329c732805f6a5422bbbb0d04a8 /meta
parent9153e6dd165800898a1e3ed595d84e2540ec8284 (diff)
downloadpoky-1974a68926064a7abebedae44658c19d98548730.tar.gz
oeqa/core/README: Improve documentation
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>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oeqa/core/README81
1 files changed, 60 insertions, 21 deletions
diff --git a/meta/lib/oeqa/core/README b/meta/lib/oeqa/core/README
index 0c859fd788..f67dff7cff 100644
--- a/meta/lib/oeqa/core/README
+++ b/meta/lib/oeqa/core/README
@@ -1,38 +1,77 @@
1= OEQA Framework = 1= OEQA (v2) Framework =
2 2
3== Introduction == 3== Introduction ==
4 4
5This is the new OEQA framework the base clases of the framework 5This is the new (version 2) OEQA framework. Base clases are located inside the
6are in this module oeqa/core the subsequent components needs to 6'oeqa/core' folder and subsequent components needs to extend from these.
7extend this classes.
8 7
9A new/unique runner was created called oe-test and is under scripts/ 8The main design consideration was to implement the needed functionality
10oe-test, this new runner scans over oeqa module searching for test 9on top of Python unittest framework. To archive the latter, the following
11components that supports OETestContextExecutor implemented in context 10modules are present:
12module (i.e. oeqa/core/context.py).
13 11
14For execute an example: 12 * oeqa/core/runner.py: Provides OETestResult and OETestRunner base
13 classes extending the unittest ones. This class has the support for
14 export results to different formats currently RAW and XML.
15 15
16$ source oe-init-build-env 16 * oeqa/core/loader.py: Provides OETestLoader extending unittest ones,
17$ oe-test core 17 also implements unified way for decorator support and for filtering test
18 cases.
18 19
19For list supported components: 20 * oeqa/core/case.py: Provides OETestCase base class extending
21 unittest.TestCase and provides access to the Test data (td), Test context
22 and Logger functionality.
20 23
21$ oe-test -h 24 * oeqa/core/decorator: Provides OETestDecorator a new class to implement
25 decorators for Test cases.
22 26
23== Create new Test component == 27 * oeqa/core/context: Provides OETestContext a high-level API for
28 loadTests and runTests of certain Test component and
29 OETestContextExecutor a base class to enable oe-test to discover/use
30 the Test component.
24 31
25Usally for add a new Test component the developer needs to extend 32In the other hand, a new 'oe-test' runner is located under 'scripts', allowing scans for components
26OETestContext/OETestContextExecutor in context.py and OETestCase in 33that supports OETestContextExecutor (see below).
27case.py.
28 34
29== How to run the testing of the OEQA framework == 35== Terminology ==
36
37 * Test component: The area of testing in the Project, for example: runtime, SDK, eSDK, selftest.
38
39 * Test data: Data associated with the Test component. Currently we use bitbake datastore as
40 a Test data input.
41
42 * Test context: A context of what tests needs to be run and how to do it, additionally provides
43 access to the Test data and could have custom methods, attrs.
44
45== oe-test ==
46
47The new tool oe-test (located at scripts) has the ability to scan the code base for test
48components and provide a unified way to run test cases. Internally it scans folders inside
49oeqa module in order to find specific classes that
50implements a test component.
51
52== Usage ==
53
54Executing the example test component
55
56 $ source oe-init-build-env
57 $ oe-test core
58
59Getting help
60
61 $ oe-test -h
62
63== Creating new Test Component ==
64
65Adding a new test component the developer needs to extend OETestContext/OETestContextExecutor
66(from context.py) and OETestCase (from case.py)
67
68== Selftesting the framework ==
30 69
31Run all tests: 70Run all tests:
32 71
33$ PATH=$PATH:../../ python3 -m unittest discover -s tests 72 $ PATH=$PATH:../../ python3 -m unittest discover -s tests
34 73
35Run some test: 74Run some test:
36 75
37$ cd tests/ 76 $ cd tests/
38$ ./test_data.py 77 $ ./test_data.py