distrodata.py: Test to track recipes without HOMEPAGE or DESCRIPTION
RFC 1/1 distrodata.py: Test to track recipes without HOMEPAGE or DESCRIPTION
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]
--- meta/lib/oeqa/selftest/cases/distrodata.py | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+)
meta/lib/oeqa/selftest/cases/distrodata.py +34 -0
@@ -40,6 +40,40 @@ 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 = [] + no_homepage = [] + 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('PN') + srcfile = rd.getVar('SRC_URI').split() + if not rd.getVar('DESCRIPTION'): + no_description.append((pn, fn)) + if not rd.getVar('HOMEPAGE'): + if len(srcfile) > 0 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.append((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
Signature · 1 line
2.17.1
some nitpick below
Quoted 22 lines · Dorinda
[YOCTO #13471]
Signed-off-by Dorinda Bassey <[email protected]>--- meta/lib/oeqa/selftest/cases/distrodata.py | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+)meta/lib/oeqa/selftest/cases/distrodata.py +7
-0@@ -40,6 +40,40 @@ 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 + """
meta/lib/oeqa/selftest/cases/distrodata.py but their recipes claim otherwise by setting UPSTREAM_VERSION_UNKNOWN. Please re · line 59
Quoted 10 lines
meta/lib/oeqa/selftest/cases/distrodata.py +10
-0+ with bb.tinfoil.Tinfoil() as tinfoil: + tinfoil.prepare(config_only=False) + no_description = [] + no_homepage = [] + 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('PN')
shouldn't it be BPN, otherwise we would get the same warning for native/cross/nativesdk and target configuration. Also I would advise to used set() instead of lists for no_description and no_homepage, just to rule out any double postings
meta/lib/oeqa/selftest/cases/distrodata.py but their recipes claim otherwise by setting UPSTREAM_VERSION_UNKNOWN. Please re · line 64
Quoted 5 lines
meta/lib/oeqa/selftest/cases/distrodata.py +5
-0+ srcfile = rd.getVar('SRC_URI').split() + if not rd.getVar('DESCRIPTION'): + no_description.append((pn, fn)) + if not rd.getVar('HOMEPAGE'): + if len(srcfile) > 0 and srcfile[0].startswith('file') or not rd.getVar('SRC_URI'):
if len(x) > 0 is a bad pattern - a pythonic way would be if x:
meta/lib/oeqa/selftest/cases/distrodata.py but their recipes claim otherwise by setting UPSTREAM_VERSION_UNKNOWN. Please re · line 75
Quoted 11 lines
meta/lib/oeqa/selftest/cases/distrodata.py +11
-0+ # We are only interested in recipes SRC_URI fetched from external sources + continue + no_homepage.append((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]))
the currently valid edition (https://www.openembedded.org/wiki/Styleguide) of the the style guide claims that DESCRIPTION defaults to SUMMARY. So I personally would rather check that SUMMARY != DESCRIPTION in case DESCRIPTION is set - by default DESCRIPTION isn't mandatory IMO (or the styleguide needs to be updated)
Quoted 9 lines
meta/lib/oeqa/selftest/cases/distrodata.py +1
-0+ def test_maintainers(self): """ Summary: Test that oe-core recipes have a maintainer and entries in maintainers list have a recipe
Alright, Thank you for the feedback.
the currently valid edition
(https://www.openembedded.org/wiki/Styleguide) of the the style guide claims that DESCRIPTION defaults to SUMMARY. So I personally would rather check that SUMMARY != DESCRIPTION in case DESCRIPTION is set - by default DESCRIPTION isn't mandatory IMO (or the styleguide needs to be updated)
I now see why I didn't get reports on recipes without DESCRIPTION.
Thanks,
Dorinda.
Quoted 88 lines · On Sat, Mar 6, 2021, 22:10 Konrad Weihmann <[email protected]> wrote:
some nitpick below
Review
Quoted 8 lines · Dorinda
[YOCTO #13471]
Signed-off-by Dorinda Bassey <[email protected]>--- meta/lib/oeqa/selftest/cases/distrodata.py | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+)(quoted diff) +0
-0
b/meta/lib/oeqa/selftest/cases/distrodata.pymeta/lib/oeqa/selftest/cases/distrodata.py but their recipes claim otherwise by setting
Quoted 4 lines
index
e1cfc3b621..d8df0b530c100644meta/lib/oeqa/selftest/cases/distrodata.py +0
-0@@ -40,6 +40,40 @@ but their recipes claim otherwise by setting
UPSTREAM_VERSION_UNKNOWN. Please remeta/lib/oeqa/selftest/cases/distrodata.py but their recipes claim otherwise by setting · line 41
Quoted 2 lines
meta/lib/oeqa/selftest/cases/distrodata.py +0
-0""" + "\n".join(regressed_successes) self.assertTrue(len(regressed_failures) == 0 and
len(regressed_successes)== 0, msg)meta/lib/oeqa/selftest/cases/distrodata.py but their recipes claim otherwise by setting UPSTREAM_VERSION_UNKNOWN. Please re
Quoted 4 lines
meta/lib/oeqa/selftest/cases/distrodata.py +3
-0+ def test_missing_homepg(self): + """ + Summary: Test for oe-core recipes that don't have aHOMEPAGE or DESCRIPTION
meta/lib/oeqa/selftest/cases/distrodata.py but their recipes claim otherwise by setting · line 46
Quoted 2 lines
meta/lib/oeqa/selftest/cases/distrodata.py +2
-0+ Expected: All oe-core recipes should have a DESCRIPTION entry + Expected: All oe-core recipes should have a HOMEPAGE entryexcept for recipes that are not fetched from external sources.
meta/lib/oeqa/selftest/cases/distrodata.py but their recipes claim otherwise by setting UPSTREAM_VERSION_UNKNOWN. Please re · line 59
Quoted 12 lines
meta/lib/oeqa/selftest/cases/distrodata.py +12
-0+ Product: oe-core + """ + with bb.tinfoil.Tinfoil() as tinfoil: + tinfoil.prepare(config_only=False) + no_description = [] + no_homepage = [] + 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('PN')shouldn't it be BPN, otherwise we would get the same warning for native/cross/nativesdk and target configuration.
Also I would advise to usedset()instead of lists forno_descriptionandno_homepage, just to rule out any double postingsmeta/lib/oeqa/selftest/cases/distrodata.py but their recipes claim otherwise by setting UPSTREAM_VERSION_UNKNOWN. Please re
Quoted 5 lines
meta/lib/oeqa/selftest/cases/distrodata.py +5
-0+ srcfile = rd.getVar('SRC_URI').split() + if not rd.getVar('DESCRIPTION'): + no_description.append((pn, fn)) + if not rd.getVar('HOMEPAGE'): + if len(srcfile) > 0 andsrcfile[0].startswith('file') or not
rd.getVar('SRC_URI'):
if len(x) > 0is a bad pattern - a pythonic way would beif x:meta/lib/oeqa/selftest/cases/distrodata.py but their recipes claim otherwise by setting · line 64
Quoted 1 line
meta/lib/oeqa/selftest/cases/distrodata.py +1
-0+ # We are only interested in recipes SRC_URIfetched from external sources
meta/lib/oeqa/selftest/cases/distrodata.py but their recipes claim otherwise by setting UPSTREAM_VERSION_UNKNOWN. Please re
Quoted 5 lines
meta/lib/oeqa/selftest/cases/distrodata.py +5
-0+ continue + no_homepage.append((pn, fn)) + if no_homepage: + self.fail(""" +The following recipes do not have a HOMEPAGE. Please add an entry forHOMEPAGE in the recipe.
meta/lib/oeqa/selftest/cases/distrodata.py but their recipes claim otherwise by setting UPSTREAM_VERSION_UNKNOWN. Please re
Quoted 4 lines
meta/lib/oeqa/selftest/cases/distrodata.py +4
-0+""" + "\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 entryfor DESCRIPTION in the recipe.
meta/lib/oeqa/selftest/cases/distrodata.py but their recipes claim otherwise by setting UPSTREAM_VERSION_UNKNOWN. Please re · line 75
Quoted 1 line
meta/lib/oeqa/selftest/cases/distrodata.py +1
-0+""" + "\n".join(['%s (%s)' % i for i in no_description]))the currently valid edition
(https://www.openembedded.org/wiki/Styleguide) of the the style guide claims that DESCRIPTION defaults to SUMMARY. So I personally would rather check that SUMMARY != DESCRIPTION in case DESCRIPTION is set - by default DESCRIPTION isn't mandatory IMO (or the styleguide needs to be updated)meta/lib/oeqa/selftest/cases/distrodata.py but their recipes claim otherwise by setting UPSTREAM_VERSION_UNKNOWN. Please re
Quoted 4 lines
meta/lib/oeqa/selftest/cases/distrodata.py +1
-0+ def test_maintainers(self): """ Summary: Test that oe-core recipes have a maintainer andentries in maintainers list have a recipe
Quoted 5 lines