generic-poky/meta/lib/oeqa/core
Leonardo Sandoval 3f32ca2a57 oeqa/core/runner: Append PID in the test result folder name
It was found a case (see the bugzilla entry) where two runners were running at the same
second, creating identical test result folders, so one of them (the second runner)
was not able to create the folder because the other has already created it,
raising the following exception (many text was removed from log)

NOTE: Executing RunQueue Tasks
NOTE: Running task 1 of 2 (/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-mips/build/meta/recipes-core/images/core-image-minimal.bb:do_testsdkext)
NOTE: Running task 2 of 2 (/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-mips/build/meta/recipes-sato/images/core-image-sato.bb:do_testsdkext)
NOTE: recipe core-image-sato-1.0-r0: task do_testsdkext: Started
NOTE: recipe core-image-minimal-1.0-r0: task do_testsdkext: Started
.
.
The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
     0001:
 *** 0002:do_testsdkext(d)
     0003:
File: '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-mips/build/meta/classes/testsdk.bbclass', lineno: 188, function: do_testsdkext
     0184:
     0185:testsdkext_main[vardepsexclude] =+ "BB_ORIGENV"
     0186:
     0187:python do_testsdkext() {
 *** 0188:    testsdkext_main(d)
     0189:}
     0190:addtask testsdkext
     0191:do_testsdkext[nostamp] = "1"
     0192:
File: '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-mips/build/meta/classes/testsdk.bbclass', lineno: 171, function: testsdkext_main
     0167:        except Exception as e:
     0168:            import traceback
     0169:            bb.fatal("Loading tests failed:\n%s" % traceback.format_exc())
     0170:
 *** 0171:        result = tc.runTests()
.
.
File: '/usr/lib64/python3.5/os.py', lineno: 241, function: makedirs
     0237:            cdir = bytes(curdir, 'ASCII')
     0238:        if tail == cdir:           # xxx/newdir/. exists if xxx/newdir exists
     0239:            return
     0240:    try:
 *** 0241:        mkdir(name, mode)
     0242:    except OSError:
     0243:        # Cannot rely on checking for EEXIST, since the operating system
     0244:        # could give priority to other errors like EACCES or EROFS
     0245:        if not exist_ok or not path.isdir(name):
Exception: FileExistsError: [Errno 17] File exists: '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-mips/build/build/TestResults_20170409130114'

[YOCTO #11318]

(From OE-Core rev: 10aa09d39c1b70ce2a88f59601f1f8dbc96ed817)

Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-13 10:54:10 +01:00
..
cases oeqa/core/cases: Add example test cases 2017-01-23 12:05:18 +00:00
decorator oeqa/core/decorator: Add skipIfNotDataVar and skipIfNotInDataVar 2017-01-23 12:05:20 +00:00
target oeqa/runtime/context.py: Fix use of getTarget() with testexport 2017-02-23 12:49:48 -08:00
tests oeqa/core: Add tests for the OEQA framework 2017-01-23 12:05:18 +00:00
utils meta: remove remaining True option to getVar calls 2017-01-31 14:43:02 +00:00
README oeqa/core: Add README 2017-01-23 12:05:18 +00:00
__init__.py oeqa/core: Add base OEQA framework 2017-01-23 12:05:18 +00:00
case.py oeqa/core: Add base OEQA framework 2017-01-23 12:05:18 +00:00
context.py oeqa/core/context.py: Add validation for run-tests option 2017-01-31 23:27:47 +00:00
exception.py oeqa/core: Add base OEQA framework 2017-01-23 12:05:18 +00:00
loader.py oeqa/core/loader.py: Do not import underscore modules by default 2017-03-28 08:43:12 +01:00
runner.py oeqa/core/runner: Append PID in the test result folder name 2017-04-13 10:54:10 +01:00

README

= OEQA Framework =

== Introduction ==

This is the new OEQA framework the base clases of the framework
are in this module oeqa/core the subsequent components needs to
extend this classes.

A new/unique runner was created called oe-test and is under scripts/
oe-test, this new runner scans over oeqa module searching for test
components that supports OETestContextExecutor implemented in context
module (i.e. oeqa/core/context.py).

For execute an example:

$ source oe-init-build-env
$ oe-test core

For list supported components:

$ oe-test -h

== Create new Test component ==

Usally for add a new Test component the developer needs to extend
OETestContext/OETestContextExecutor in context.py and OETestCase in
case.py.

== How to run the testing of the OEQA framework ==

Run all tests:

$ PATH=$PATH:../../ python3 -m unittest discover -s tests

Run some test:

$ cd tests/
$ ./test_data.py