]> code.ossystems Code Review - openembedded-core.git/commit
testimage: sort modules based on dependencies
authorPatrick Ohly <patrick.ohly@intel.com>
Thu, 9 Apr 2015 09:24:24 +0000 (02:24 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 9 Apr 2015 18:48:01 +0000 (19:48 +0100)
commit6e4543a35836c572b23b9f8162b19d1e038d3ed2
tree1eabddace218e91c31c425eb162e8922af5dfc3b
parentca23337d517cfdb7119e5fd8bd9a9a663ae135de
testimage: sort modules based on dependencies

TEST_SUITES="auto" is useful to run all suitable tests without
having to hard-code the list. However, it did not take test
dependencies into account, which can be an issue for tests
which really depend on some other test to run first.

To fix this, modules get loaded in the order determined by
TESTS_SUITES, but then get re-ordered based on dependencies
derived from @skipUnlessPassed before running them. The original
order is used to break ties when there are no dependencies, so
reordering only occurs when really necessary.

@skipUnlessPassed gets extended such that it makes the test name
a method depends on available for inspection by the test loader
in oetest.py.

Unfortunately Python's unittest offers no API to inspect tests
in a TestSuite, so the code has to rely on implementation details
to find all tests. The worst that can happen when the implementation
changes is that tests are not found and reordering does not happen.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/testimage.bbclass
meta/lib/oeqa/oetest.py
meta/lib/oeqa/utils/decorators.py