]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
oeqa/decorator: Improve reliability
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 15 Jul 2018 12:02:50 +0000 (12:02 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 18 Jul 2018 09:09:29 +0000 (10:09 +0100)
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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/core/decorator/depends.py

index 69c604d8f4b9b0811361afe0bf30768a61a7b7fe..950dbaa67a377e28a3f9154290709aadadb392ff 100644 (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):