All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dorinda" <dorindabassey@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Dorinda Bassey <dorindabassey@gmail.com>
Subject: [PATCH v2][RFC] distrodata.py: Test to track recipes without HOMEPAGE or DESCRIPTION
Date: Mon,  8 Mar 2021 22:12:07 +0100	[thread overview]
Message-ID: <20210308211207.6853-1-dorindabassey@gmail.com> (raw)

From: Dorinda Bassey <dorindabassey@gmail.com>

This test is to keep track of recipes that do not have a HOMEPAGE or DESCRIPTION,
with exceptions to recipes whose SRC_URI are not linked to external sources.

[YOCTO #13471]

Signed-off-by: Dorinda Bassey <dorindabassey@gmail.com>
---
v2:
-Changed PN to BPN
-Used set() instead of lists
-Changed condition for checking recipes with missing DESCRIPTION

 meta/lib/oeqa/selftest/cases/distrodata.py | 36 ++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/meta/lib/oeqa/selftest/cases/distrodata.py b/meta/lib/oeqa/selftest/cases/distrodata.py
index e1cfc3b621..633bf25dc7 100644
--- a/meta/lib/oeqa/selftest/cases/distrodata.py
+++ b/meta/lib/oeqa/selftest/cases/distrodata.py
@@ -40,6 +40,42 @@ but their recipes claim otherwise by setting UPSTREAM_VERSION_UNKNOWN. Please re
 """ + "\n".join(regressed_successes)
         self.assertTrue(len(regressed_failures) == 0 and len(regressed_successes) == 0, msg)
 
+    def test_missing_homepg(self):
+        """
+        Summary:     Test for oe-core recipes that don't have a HOMEPAGE or DESCRIPTION
+        Expected:    All oe-core recipes should have a DESCRIPTION entry
+        Expected:    All oe-core recipes should have a HOMEPAGE entry except for recipes that are not fetched from external sources.
+        Product:     oe-core
+        """
+        with bb.tinfoil.Tinfoil() as tinfoil:
+            tinfoil.prepare(config_only=False)
+            no_description = set()
+            no_homepage = set()
+            for fn in tinfoil.all_recipe_files(variants=False):
+                if not '/meta/recipes-' in fn:
+                    # We are only interested in OE-Core
+                    continue
+                rd = tinfoil.parse_recipe_file(fn, appends=False)
+                pn = rd.getVar('BPN')
+                srcfile = rd.getVar('SRC_URI').split()
+                #Since DESCRIPTION defaults to SUMMARY if not set, we are only interested in recipes without DESCRIPTION or SUMMARY
+                if not (rd.getVar('SUMMARY') or rd.getVar('DESCRIPTION')):
+                    no_description.add((pn, fn))
+                if not rd.getVar('HOMEPAGE'):
+                    if srcfile and srcfile[0].startswith('file') or not rd.getVar('SRC_URI'):
+                        # We are only interested in recipes SRC_URI fetched from external sources
+                        continue
+                    no_homepage.add((pn, fn))
+        if no_homepage:
+            self.fail("""
+The following recipes do not have a HOMEPAGE. Please add an entry for HOMEPAGE in the recipe.
+""" + "\n".join(['%s (%s)' % i for i in no_homepage]))
+
+        if no_description:
+            self.fail("""
+The following recipes do not have a DESCRIPTION. Please add an entry for DESCRIPTION in the recipe.
+""" + "\n".join(['%s (%s)' % i for i in no_description]))
+
     def test_maintainers(self):
         """
         Summary:     Test that oe-core recipes have a maintainer and entries in maintainers list have a recipe
-- 
2.17.1


             reply	other threads:[~2021-03-08 21:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-08 21:12 Dorinda [this message]
2021-03-12  2:11 ` [OE-core] [PATCH v2][RFC] distrodata.py: Test to track recipes without HOMEPAGE or DESCRIPTION Randy MacLeod
2021-03-12 20:44   ` Dorinda
2021-03-13 22:01     ` Randy MacLeod

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=20210308211207.6853-1-dorindabassey@gmail.com \
    --to=dorindabassey@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 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.