public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Ricardo Ungerer <ungerer.ricardo@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Ricardo Ungerer <ungerer.ricardo@gmail.com>
Subject: [PATCH 1/3] yocto-check-layer: Add messages in test_readme assertions
Date: Tue, 20 Jan 2026 19:47:20 +0000	[thread overview]
Message-ID: <20260120194722.142355-2-ungerer.ricardo@gmail.com> (raw)
In-Reply-To: <20260120194722.142355-1-ungerer.ricardo@gmail.com>

Assertions in test_readme does not provide context message when they
fail. Which leads to errors like:

  File "/media/workspace/yocto_master/openembedded-core/scripts/lib/checklayer/cases/common.py", line 41, in test_readme
    self.assertTrue(email_regex.match(data))
    AssertionError: None is not true

This patch adds context messages to the assertions to help identify the
issue when they fail.

Signed-off-by: Ricardo Ungerer <ungerer.ricardo@gmail.com>
---
 scripts/lib/checklayer/cases/common.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/scripts/lib/checklayer/cases/common.py b/scripts/lib/checklayer/cases/common.py
index ddead69a7b..0114481434 100644
--- a/scripts/lib/checklayer/cases/common.py
+++ b/scripts/lib/checklayer/cases/common.py
@@ -32,13 +32,14 @@ class CommonCheckLayer(OECheckLayerTestCase):
 
         # If a layer's README references another README, then the checks below are not valid
         if re.search('README', data, re.IGNORECASE):
+            print("Layer README references another README; skipping further README checks.")
             return
 
-        self.assertIn('maintainer', data.lower())
-        self.assertIn('patch', data.lower())
+        self.assertIn('maintainer', data.lower(), msg="No maintainer info found in README.")
+        self.assertIn('patch', data.lower(), msg="No patching information found in README.")
         # Check that there is an email address in the README
         email_regex = re.compile(r"[^@]+@[^@]+")
-        self.assertTrue(email_regex.match(data))
+        self.assertTrue(email_regex.match(data), msg="No email address found in README.")
 
     def find_file_by_name(self, globs):
         """
-- 
2.43.0



  reply	other threads:[~2026-01-20 19:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-20 19:47 [PATCH 0/3] Improve yocto-check-layer test_readme method Ricardo Ungerer
2026-01-20 19:47 ` Ricardo Ungerer [this message]
2026-01-20 19:47 ` [PATCH 2/3] yocto-check-layer: Fix README email check Ricardo Ungerer
2026-01-20 19:47 ` [PATCH 3/3] yocto-check-layer: Add docstring to test_readme method Ricardo Ungerer
2026-01-20 20:00   ` Patchtest results for " patchtest
2026-01-21  9:25 ` [OE-core] [PATCH 0/3] Improve yocto-check-layer " Quentin Schulz

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=20260120194722.142355-2-ungerer.ricardo@gmail.com \
    --to=ungerer.ricardo@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox