diff options
author | Patrick Ohly <patrick.ohly@intel.com> | 2015-04-09 02:24:24 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-04-10 18:10:25 +0100 |
commit | f626c58c325bfbf5fce1b5b2defafee9c6b74ea3 (patch) | |
tree | 9ef4e822c512b9b3c08a3fdba42605f7e7d3cf47 /meta/lib/oeqa/utils | |
parent | 206d532180eca9c32e86d1ee36d4b8c61b15436b (diff) | |
download | poky-f626c58c325bfbf5fce1b5b2defafee9c6b74ea3.tar.gz |
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.
(From OE-Core rev: 6e4543a35836c572b23b9f8162b19d1e038d3ed2)
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/utils')
-rw-r--r-- | meta/lib/oeqa/utils/decorators.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/meta/lib/oeqa/utils/decorators.py b/meta/lib/oeqa/utils/decorators.py index ff5f278bc1..1e5a890fdd 100644 --- a/meta/lib/oeqa/utils/decorators.py +++ b/meta/lib/oeqa/utils/decorators.py | |||
@@ -85,6 +85,7 @@ class skipUnlessPassed(object): | |||
85 | raise unittest.SkipTest("Testcase dependency not met: %s" % self.testcase) | 85 | raise unittest.SkipTest("Testcase dependency not met: %s" % self.testcase) |
86 | return f(*args) | 86 | return f(*args) |
87 | wrapped_f.__name__ = f.__name__ | 87 | wrapped_f.__name__ = f.__name__ |
88 | wrapped_f._depends_on = self.testcase | ||
88 | return wrapped_f | 89 | return wrapped_f |
89 | 90 | ||
90 | class testcase(object): | 91 | class testcase(object): |