Re: [OE-core] [PATCH 7/8] oeqa/runtime/rpm: fail tests if test rpm file cannot be found

Alexander Kanavin
2024-01-26T14:21:32Z

On Fri, 26 Jan 2024 at 15:11, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
>
> On Fri, 2024-01-26 at 14:34 +0100, Alexander Kanavin wrote:
> > Discovery of the test file was happening in a class initializer.
> > That block of code cannot fail (it's not a test), and so it
> > falls through to completion even if the needed file could not be found.
>
> Is that true? I thought a failure in the setup function just caused all
> the tests in that class not to run?

I think I didn't formulate it well enough. The rpm test initalizer was
written in a way that it would never fail, even if the needed rpm file
actually could not be discovered and the variable for it (used by test
cases) would remain None.

The reason for it being that way is that the initializer runs even
when the build is not-rpm based (e.g. ipk/deb only), and there's no
way at that point to detect absence of rpm and skip the whole class
(various decorators can be attached to test cases only).

Alex