All of lore.kernel.org
 help / color / mirror / Atom feed
From: alexis.lothore@bootlin.com
To: <Openembedded-core@lists.openembedded.org>
Cc: "Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Alexis Lothoré" <alexis.lothore@bootlin.com>
Subject: [OE-Core][PATCH v3 1/4] oeqa/core/runner: add helper to know about expected failures
Date: Fri,  9 Jun 2023 08:47:59 +0200	[thread overview]
Message-ID: <20230609064802.11777-2-alexis.lothore@bootlin.com> (raw)
In-Reply-To: <20230609064802.11777-1-alexis.lothore@bootlin.com>

From: Alexis Lothoré <alexis.lothore@bootlin.com>

Testing framework currently uses the unittest.expectedFailure decorator for
tests that can have intermittent failures (see PTEST_EXPECT_FAILURE = "1")
in core-image-ptest.bb. While it allows upper layers to run tests without
failing on "fragile" tests, it prevents those from knowing more about those
failing tests since they are not accounting as failures (for example we
could want to retrieve some logs about failed tests to improve them, and
eventually to drop expectFailure decorator)

Add a helper to allow upper layers to know about those failures which won't
make global testing session

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
---
 meta/lib/oeqa/core/runner.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/meta/lib/oeqa/core/runner.py b/meta/lib/oeqa/core/runner.py
index d50690ab37f8..5077eb8e3e32 100644
--- a/meta/lib/oeqa/core/runner.py
+++ b/meta/lib/oeqa/core/runner.py
@@ -229,6 +229,10 @@ class OETestResult(_TestResult):
         # Override as we unexpected successes aren't failures for us
         return (len(self.failures) == len(self.errors) == 0)
 
+    def hasAnyFailingTest(self):
+        # Account for expected failures
+        return not self.wasSuccessful() or len(self.expectedFailures)
+
 class OEListTestsResult(object):
     def wasSuccessful(self):
         return True
-- 
2.40.1



  reply	other threads:[~2023-06-09  6:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-09  6:47 [OE-Core][PATCH v3 0/4] add failed tests artifacts retriever alexis.lothore
2023-06-09  6:47 ` alexis.lothore [this message]
2023-06-09  6:48 ` [OE-Core][PATCH v3 2/4] oeqa/target/ssh: update options for SCP alexis.lothore
2023-06-09  6:48 ` [OE-Core][PATCH v3 3/4] testimage: implement test artifacts retriever for failing tests alexis.lothore
2023-06-09  6:48 ` [OE-Core][PATCH v3 4/4] core-image-ptest: append ptest directory to artifacts list alexis.lothore
2023-06-09  6:52   ` Mikko Rapeli
2023-06-09  7:24     ` Alexis Lothoré
2023-06-11 15:16       ` Alexander Kanavin
2023-06-11 15:48         ` Alex Kiernan
2023-06-15  7:03         ` Richard Purdie
2023-06-15  8:34           ` Mikko Rapeli
2023-06-15  9:05             ` Richard Purdie
2023-06-15 21:27               ` Peter Kjellerstedt

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=20230609064802.11777-2-alexis.lothore@bootlin.com \
    --to=alexis.lothore@bootlin.com \
    --cc=Openembedded-core@lists.openembedded.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=thomas.petazzoni@bootlin.com \
    /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.