Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Thune Tran <thune.a.tran@boeing.com>
To: openembedded-core@lists.openembedded.org
Cc: Thune Tran <thune.a.tran@boeing.com>,
	Chuck Wolber <chuck.wolber@boeing.com>
Subject: [PATCH] oeqa/sdk/sdktest: Add test discovery across layers
Date: Wed, 16 Apr 2025 16:41:34 +0000	[thread overview]
Message-ID: <20250416164134.399-1-thune.a.tran@boeing.com> (raw)

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



             reply	other threads:[~2025-04-16 16:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-16 16:41 Thune Tran [this message]
2025-04-16 17:23 ` [OE-core] [PATCH] oeqa/sdk/sdktest: Add test discovery across layers 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250416164134.399-1-thune.a.tran@boeing.com \
    --to=thune.a.tran@boeing.com \
    --cc=chuck.wolber@boeing.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox