From: Jérémy Rosen <jeremy.ro...@smile.fr>

This infrastructure will use heuristics to detect when package sources seem
to have unit tests implemented but no ptest have been implemented in the
recipe.

No heuristics have been implemented at this point, only the infrastructure
to skip the test when ptest are implemented.

This is part of python_do_qa_patch since we need the sources in their final
state but do not need any configuration done

A missing-ptest QA test already existed but it was used for a different
purpose and overridden by ptest.bbclass. Thus, a new QA keyword was added

Note: The QA test is not enabled by default and may be enabled to hunt
down potential ptests with:
  WARN_QA += "unimplemented-ptest"

Signed-off-by: Jérémy Rosen <jeremy.ro...@smile.fr>
Reviewed-by: Yoann Congal <yoann.con...@smile.fr>
---
 meta/classes-global/insane.bbclass | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/meta/classes-global/insane.bbclass 
b/meta/classes-global/insane.bbclass
index 5743d91240..857f0a3736 100644
--- a/meta/classes-global/insane.bbclass
+++ b/meta/classes-global/insane.bbclass
@@ -1348,6 +1348,18 @@ python do_qa_patch() {
         if msg:
             oe.qa.handle_error("patch-status", msg, d)
 
+    ###########################################################################
+    # Check for missing ptests
+    ###########################################################################
+    srcdir = d.getVar('S')
+    if not bb.utils.contains('DISTRO_FEATURES', 'ptest', True, False, d):
+        pass
+    elif any(override in ["class-native", "class-nativesdk", 
"class-cross-canadian"] for override in d.getVar('OVERRIDES').split(':')):
+        # These cases are forcibly disabled in ptest.bbclass, so don't report 
missing ptest for them
+        bb.note("Package %s QA: skipping unimplemented-ptest: ptests disabled 
for this recipe class" % d.getVar('PN'))
+    elif bb.data.inherits_class('ptest', d):
+        bb.note("Package %s QA: skipping unimplemented-ptest: ptest 
implementation detected" % d.getVar('PN'))
+
     oe.qa.exit_if_errors(d)
 }
 
-- 
2.30.2

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#188681): 
https://lists.openembedded.org/g/openembedded-core/message/188681
Mute This Topic: https://lists.openembedded.org/mt/101754136/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to