All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 6/6] oeqa/decorator: Improve reliability
Date: Mon, 16 Jul 2018 17:33:25 +0100	[thread overview]
Message-ID: <20180716163325.13847-6-richard.purdie@linuxfoundation.org> (raw)
In-Reply-To: <20180716163325.13847-1-richard.purdie@linuxfoundation.org>

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 | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/meta/lib/oeqa/core/decorator/depends.py b/meta/lib/oeqa/core/decorator/depends.py
index 69c604d8f4b..109cc88cff9 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):
     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(), test.id()))
 
 @registerDecorator
 class OETestDepends(OETestDiscover):
-- 
2.17.1



  parent reply	other threads:[~2018-07-16 16:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-16 16:33 [PATCH 1/6] oeqa: Add selftest parallelisation support Richard Purdie
2018-07-16 16:33 ` [PATCH 2/6] oeqa/core/threaded: Remove in favour of using concurrenttests Richard Purdie
2018-07-16 16:33 ` [PATCH 3/6] oeqa/runner: Simplify code Richard Purdie
2018-07-16 16:33 ` [PATCH 4/6] oeqa: Remove xmlrunner Richard Purdie
2018-07-16 16:33 ` [PATCH 5/6] testsdk: Enable multiprocess execution Richard Purdie
2018-07-16 16:33 ` Richard Purdie [this message]
2018-07-26  3:03 ` [PATCH 1/6] oeqa: Add selftest parallelisation support Robert Yang
2018-07-26  6:00   ` Robert Yang
2018-07-26  9:10     ` richard.purdie
2018-07-26  9:18       ` Robert Yang
2018-07-26  9:37         ` ChenQi
2018-07-26 11:11           ` richard.purdie
2018-07-27  3:18             ` Robert Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180716163325.13847-6-richard.purdie@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.