]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
yocto-check-layer: expand to cover all required QA checks
authorDenys Dmytriyenko <denys@konsulko.com>
Wed, 20 Nov 2024 00:22:42 +0000 (19:22 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 3 Dec 2024 11:34:40 +0000 (11:34 +0000)
insane.bbclass now defines CHECKLAYER_REQUIRED_TESTS list with required
QA checks that are becoming mandatory for Yocto Project Compatible layers.

Update yocto-check-layer.bbclass in order to catch when packages from such
layers try to skip any of the required QA checks.

Signed-off-by: Denys Dmytriyenko <denys@konsulko.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-global/yocto-check-layer.bbclass [new file with mode: 0644]
meta/classes/yocto-check-layer.bbclass [deleted file]

diff --git a/meta/classes-global/yocto-check-layer.bbclass b/meta/classes-global/yocto-check-layer.bbclass
new file mode 100644 (file)
index 0000000..1cdab49
--- /dev/null
@@ -0,0 +1,28 @@
+#
+# Copyright OpenEmbedded Contributors
+#
+# SPDX-License-Identifier: MIT
+#
+
+#
+# This class is used by yocto-check-layer script to ensure that packages
+# from Yocto Project Compatible layers don't skip required QA checks listed
+# in CHECKLAYER_REQUIRED_TESTS defined by insane.bbclass
+#
+# It adds an anonymous python function with extra processing to all recipes,
+# globally inheriting this class isn't advisable - yocto-check-layer script
+# handles that during its signature dump
+#
+
+python () {
+    required_tests = set((d.getVar('CHECKLAYER_REQUIRED_TESTS') or '').split())
+    packages = set((d.getVar('PACKAGES') or '').split())
+    for package in packages:
+        skip = set((d.getVar('INSANE_SKIP') or "").split() +
+                   (d.getVar('INSANE_SKIP:' + package) or "").split())
+        skip_required = skip & required_tests
+        if skip_required:
+            oe.qa.write_error(" ".join(skip_required), 'Package %s is skipping required QA tests.' % package, d)
+            bb.error("QA Issue: %s [%s]" % ('Package %s is skipping required QA tests.' % package, " ".join(skip_required)))
+            d.setVar("QA_ERRORS_FOUND", "True")
+}
diff --git a/meta/classes/yocto-check-layer.bbclass b/meta/classes/yocto-check-layer.bbclass
deleted file mode 100644 (file)
index 404f5fd..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# Copyright OpenEmbedded Contributors
-#
-# SPDX-License-Identifier: MIT
-#
-
-#
-# This class is used by yocto-check-layer script for additional per-recipe tests
-# The first test ensures that the layer has no recipes skipping 'installed-vs-shipped' QA checks
-#
-
-WARN_QA:remove = "installed-vs-shipped"
-ERROR_QA:append = " installed-vs-shipped"
-
-python () {
-    packages = set((d.getVar('PACKAGES') or '').split())
-    for package in packages:
-        skip = set((d.getVar('INSANE_SKIP') or "").split() +
-                   (d.getVar('INSANE_SKIP:' + package) or "").split())
-        if 'installed-vs-shipped' in skip:
-            oe.qa.handle_error("installed-vs-shipped", 'Package %s is skipping "installed-vs-shipped" QA test.' % package, d)
-}