diff mbox series

oeqa: do not fail when sdk package is not available

Message ID 20250723062616.101590-1-peter.marko@siemens.com
State New
Headers show
Series oeqa: do not fail when sdk package is not available | expand

Commit Message

Marko, Peter July 23, 2025, 6:26 a.m. UTC
From: Peter Marko <peter.marko@siemens.com>

Prior to commits:
* 11277efd057685558a744e98082b5709e849dd2a
* d0e8b83d05957b1f22d08582e364afa4b522801e
the tests were skipped if package was not available.
Now the code calls function ensure_host_package which says
"try to sdk-install missing dependencies", however in fact for sdkext it
causes a failure if the installation is not available.

Since maturin is not installed in any image, it cannot be installed
unless it's downloaded from sstate-cache mirror populated by a world
build. These builds are however now not done for powerpc and mips.
It also does not work in local builds without sstate-cache mirror.

Fix this by skipping the test if the package cannot be installed to
match the original behavior before those commits.

Signed-off-by: Peter Marko <peter.marko@siemens.com>
Cc: Ross Burton <ross.burton@arm.com>
Cc: Khem Raj <raj.khem@gmail.com>
---
 meta/lib/oeqa/sdk/case.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Khem Raj July 23, 2025, 6:36 a.m. UTC | #1
On Tue, Jul 22, 2025 at 11:26 PM Peter Marko <peter.marko@siemens.com> wrote:
>
> From: Peter Marko <peter.marko@siemens.com>
>
> Prior to commits:
> * 11277efd057685558a744e98082b5709e849dd2a
> * d0e8b83d05957b1f22d08582e364afa4b522801e
> the tests were skipped if package was not available.
> Now the code calls function ensure_host_package which says
> "try to sdk-install missing dependencies", however in fact for sdkext it
> causes a failure if the installation is not available.
>
> Since maturin is not installed in any image, it cannot be installed
> unless it's downloaded from sstate-cache mirror populated by a world
> build. These builds are however now not done for powerpc and mips.

Yeah I was doing riscv32 build which is also not part of world targets

> It also does not work in local builds without sstate-cache mirror.
>
> Fix this by skipping the test if the package cannot be installed to
> match the original behavior before those commits.
>
> Signed-off-by: Peter Marko <peter.marko@siemens.com>
> Cc: Ross Burton <ross.burton@arm.com>
> Cc: Khem Raj <raj.khem@gmail.com>
> ---
>  meta/lib/oeqa/sdk/case.py | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/meta/lib/oeqa/sdk/case.py b/meta/lib/oeqa/sdk/case.py
> index 1fd3b3b569..002eed271d 100644
> --- a/meta/lib/oeqa/sdk/case.py
> +++ b/meta/lib/oeqa/sdk/case.py
> @@ -44,7 +44,10 @@ class OESDKTestCase(OETestCase):
>              if isinstance(self.tc, OESDKExtTestContext):
>                  recipe = (recipe or packages[0]) + "-native"
>                  print("Trying to install %s..." % recipe)
> -                self._run('devtool sdk-install %s' % recipe)
> +                try:
> +                    self._run('devtool sdk-install %s' % recipe)
> +                except:
> +                    raise unittest.SkipTest("Test %s needs one of %s" % (self.id(), ", ".join(packages)))
>              else:
>                  raise unittest.SkipTest("Test %s needs one of %s" % (self.id(), ", ".join(packages)))
>
diff mbox series

Patch

diff --git a/meta/lib/oeqa/sdk/case.py b/meta/lib/oeqa/sdk/case.py
index 1fd3b3b569..002eed271d 100644
--- a/meta/lib/oeqa/sdk/case.py
+++ b/meta/lib/oeqa/sdk/case.py
@@ -44,7 +44,10 @@  class OESDKTestCase(OETestCase):
             if isinstance(self.tc, OESDKExtTestContext):
                 recipe = (recipe or packages[0]) + "-native"
                 print("Trying to install %s..." % recipe)
-                self._run('devtool sdk-install %s' % recipe)
+                try:
+                    self._run('devtool sdk-install %s' % recipe)
+                except:
+                    raise unittest.SkipTest("Test %s needs one of %s" % (self.id(), ", ".join(packages)))
             else:
                 raise unittest.SkipTest("Test %s needs one of %s" % (self.id(), ", ".join(packages)))