Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] oeqa/sdk/sdktest: Add test discovery across layers
@ 2025-04-16 16:41 Thune Tran
  2025-04-16 17:23 ` [OE-core] " Gyorgy Sarvari
  2025-04-16 22:07 ` Richard Purdie
  0 siblings, 2 replies; 12+ messages in thread
From: Thune Tran @ 2025-04-16 16:41 UTC (permalink / raw)
  To: openembedded-core; +Cc: Thune Tran, Chuck Wolber

The testsdk task only loads SDK tests from the openembedded-core
layer's meta/lib/oeqa/sdk/cases/.

This patch implements test discovery to include SDK tests from all
configured layers that mirror <LAYER_DIR>/lib/oeqa/sdk/cases/. The
implementation mirrors get_runtime_paths() in meta/classes-recipe/testimage.

Tested by:

1. Adding SDK test cases to <LAYER_DIR>/lib/oeqa/sdk/cases/ and
   verifying they are discovered and executed with no errors.
2. Verifying existing SDK test cases in openembedded-core layer
   are discovered and executed with no errors.

Signed-off-by: Thune Tran <thune.a.tran@boeing.com>
Signed-off-by: Chuck Wolber <chuck.wolber@boeing.com>
---
 meta/lib/oeqa/sdk/testsdk.py | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oeqa/sdk/testsdk.py b/meta/lib/oeqa/sdk/testsdk.py
index 518b09febb..505add8f8c 100644
--- a/meta/lib/oeqa/sdk/testsdk.py
+++ b/meta/lib/oeqa/sdk/testsdk.py
@@ -31,6 +31,20 @@ class TestSDK(TestSDKBase):
     context_class = OESDKTestContext
     test_type = 'sdk'
 
+    def get_sdk_paths(self, d):
+        """
+        Returns a list of paths where SDK test must reside.
+
+        SDK tests are expected in <LAYER_DIR>/lib/oeqa/sdk/cases/
+        """
+        paths = []
+
+        for layer in d.getVar('BBLAYERS').split():
+            path = os.path.join(layer, 'lib/oeqa/sdk/cases')
+            if os.path.isdir(path):
+                paths.append(path)
+        return paths
+
     def get_tcname(self, d):
         """
         Get the name of the SDK file
@@ -114,7 +128,7 @@ class TestSDK(TestSDKBase):
                 host_pkg_manifest=host_pkg_manifest, **context_args)
 
             try:
-                tc.loadTests(self.context_executor_class.default_cases)
+                tc.loadTests(self.get_sdk_paths(d))
             except Exception as e:
                 import traceback
                 bb.fatal("Loading tests failed:\n%s" % traceback.format_exc())
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-04-21 19:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-16 16:41 [PATCH] oeqa/sdk/sdktest: Add test discovery across layers Thune Tran
2025-04-16 17:23 ` [OE-core] " Gyorgy Sarvari
2025-04-16 20:54   ` Tran (US), Thune A
2025-04-16 21:16     ` Gyorgy Sarvari
2025-04-16 22:07 ` Richard Purdie
2025-04-17  4:39   ` Chuck Wolber
2025-04-17 10:06     ` Gyorgy Sarvari
2025-04-17 11:04     ` Richard Purdie
2025-04-17 12:54       ` Tran (US), Thune A
2025-04-17 13:03         ` Richard Purdie
2025-04-17 15:53           ` Tran (US), Thune A
     [not found]           ` <18372610739395C0.11203@lists.openembedded.org>
2025-04-21 19:21             ` Tran (US), Thune A

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox