summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/core
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-15 12:02:50 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-18 10:18:41 +0100
commit928d6159ed9870580736979baf021287a96afd93 (patch)
tree31b4b76de21a387d1db515f08772c06ff4250b74 /meta/lib/oeqa/core
parentda596a2ad642da00c5665caeedcd258d4a34e2f8 (diff)
downloadpoky-928d6159ed9870580736979baf021287a96afd93.tar.gz
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>
Diffstat (limited to 'meta/lib/oeqa/core')
-rw-r--r--meta/lib/oeqa/core/decorator/depends.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/meta/lib/oeqa/core/decorator/depends.py b/meta/lib/oeqa/core/decorator/depends.py
index 69c604d8f4..950dbaa67a 100644
--- a/meta/lib/oeqa/core/decorator/depends.py
+++ b/meta/lib/oeqa/core/decorator/depends.py
@@ -63,13 +63,15 @@ def _order_test_case_by_depends(cases, depends):
63 return [cases[case_id] for case_id in cases_ordered] 63 return [cases[case_id] for case_id in cases_ordered]
64 64
65def _skipTestDependency(case, depends): 65def _skipTestDependency(case, depends):
66 skipReasons = ['errors', 'failures', 'skipped'] 66 for dep in depends:
67 67 found = False
68 for reason in skipReasons: 68 for test, _ in case.tc.results.successes:
69 for test, _ in getattr(case.tc.results, reason): 69 if test.id() == dep:
70 if test.id() in depends: 70 found = True
71 raise SkipTest("Test case %s depends on %s and was in %s." \ 71 break
72 % (case.id(), test.id(), reason)) 72 if not found:
73 raise SkipTest("Test case %s depends on %s but it didn't pass/run." \
74 % (case.id(), dep))
73 75
74@registerDecorator 76@registerDecorator
75class OETestDepends(OETestDiscover): 77class OETestDepends(OETestDiscover):