1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-08 05:09:24 +00:00

oeqa/decorator: Improve reliability

Checking if the dependency had any failure is unreliable, for example
if the underlying data doesn't get transferred and the list is empty,
success of the dependency is assumed.

Since we now have success data available, change the code to use it.

(From OE-Core rev: 4abba4c30d5a6163a968a119395a679e5e281ab4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2018-07-15 12:02:50 +00:00
parent da596a2ad6
commit 928d6159ed
+9 -7
View File
@@ -63,13 +63,15 @@ def _order_test_case_by_depends(cases, depends):
return [cases[case_id] for case_id in cases_ordered]
def _skipTestDependency(case, depends):
skipReasons = ['errors', 'failures', 'skipped']
for reason in skipReasons:
for test, _ in getattr(case.tc.results, reason):
if test.id() in depends:
raise SkipTest("Test case %s depends on %s and was in %s." \
% (case.id(), test.id(), reason))
for dep in depends:
found = False
for test, _ in case.tc.results.successes:
if test.id() == dep:
found = True
break
if not found:
raise SkipTest("Test case %s depends on %s but it didn't pass/run." \
% (case.id(), dep))
@registerDecorator
class OETestDepends(OETestDiscover):