diff options
| author | Dorinda Bassey <dorindabassey@gmail.com> | 2021-03-14 13:58:03 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-03-15 14:37:40 +0000 |
| commit | a6932c2203cf89f072b7e9a266fd22b384ece6a4 (patch) | |
| tree | 93abdba7a32846a92e47e7f22005675b4b54b10b /meta/lib | |
| parent | 028fcc234840dee58cc3c5e74ce3e44d0ebedb55 (diff) | |
| download | poky-a6932c2203cf89f072b7e9a266fd22b384ece6a4.tar.gz | |
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.
Results of this test: it take about 2 to 3 minutes for this test to complete execution
depending on the laptop used, Recipes that didn't have a homepage or description were found,
and using list data structure instead of set() returned an ordered list of recipes that
didn't have a homepage. Hence it's easier to view recipes with missing homepage and description.
[YOCTO #13471]
(From OE-Core rev: 5e0cfce7a126c194bfb7855952355c62eae3831a)
Signed-off-by: Dorinda Bassey <dorindabassey@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
| -rw-r--r-- | meta/lib/oeqa/selftest/cases/distrodata.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/distrodata.py b/meta/lib/oeqa/selftest/cases/distrodata.py index e1cfc3b621..fbc0c2a98d 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 | |||
| 40 | """ + "\n".join(regressed_successes) | 40 | """ + "\n".join(regressed_successes) |
| 41 | self.assertTrue(len(regressed_failures) == 0 and len(regressed_successes) == 0, msg) | 41 | self.assertTrue(len(regressed_failures) == 0 and len(regressed_successes) == 0, msg) |
| 42 | 42 | ||
| 43 | def test_missing_homepg(self): | ||
| 44 | """ | ||
| 45 | Summary: Test for oe-core recipes that don't have a HOMEPAGE or DESCRIPTION | ||
| 46 | Expected: All oe-core recipes should have a DESCRIPTION entry | ||
| 47 | Expected: All oe-core recipes should have a HOMEPAGE entry except for recipes that are not fetched from external sources. | ||
| 48 | Product: oe-core | ||
| 49 | """ | ||
| 50 | with bb.tinfoil.Tinfoil() as tinfoil: | ||
| 51 | tinfoil.prepare(config_only=False) | ||
| 52 | no_description = [] | ||
| 53 | no_homepage = [] | ||
| 54 | for fn in tinfoil.all_recipe_files(variants=False): | ||
| 55 | if not '/meta/recipes-' in fn: | ||
| 56 | # We are only interested in OE-Core | ||
| 57 | continue | ||
| 58 | rd = tinfoil.parse_recipe_file(fn, appends=False) | ||
| 59 | pn = rd.getVar('BPN') | ||
| 60 | srcfile = rd.getVar('SRC_URI').split() | ||
| 61 | #Since DESCRIPTION defaults to SUMMARY if not set, we are only interested in recipes without DESCRIPTION or SUMMARY | ||
| 62 | if not (rd.getVar('SUMMARY') or rd.getVar('DESCRIPTION')): | ||
| 63 | no_description.append((pn, fn)) | ||
| 64 | if not rd.getVar('HOMEPAGE'): | ||
| 65 | if srcfile and srcfile[0].startswith('file') or not rd.getVar('SRC_URI'): | ||
| 66 | # We are only interested in recipes SRC_URI fetched from external sources | ||
| 67 | continue | ||
| 68 | no_homepage.append((pn, fn)) | ||
| 69 | if no_homepage: | ||
| 70 | self.fail(""" | ||
| 71 | The following recipes do not have a HOMEPAGE. Please add an entry for HOMEPAGE in the recipe. | ||
| 72 | """ + "\n".join(['%s (%s)' % i for i in no_homepage])) | ||
| 73 | |||
| 74 | if no_description: | ||
| 75 | self.fail(""" | ||
| 76 | The following recipes do not have a DESCRIPTION. Please add an entry for DESCRIPTION in the recipe. | ||
| 77 | """ + "\n".join(['%s (%s)' % i for i in no_description])) | ||
| 78 | |||
| 43 | def test_maintainers(self): | 79 | def test_maintainers(self): |
| 44 | """ | 80 | """ |
| 45 | Summary: Test that oe-core recipes have a maintainer and entries in maintainers list have a recipe | 81 | Summary: Test that oe-core recipes have a maintainer and entries in maintainers list have a recipe |
