Mailinglist Archive: opensuse-packaging (121 mails)

< Previous Next >
Re: [opensuse-packaging] Something like BuildRecommends to increase test coverage?
On 2019-03-12 11:19:52 +0100, Adam Majer wrote:
On 3/11/19 11:47 PM, Bernhard Voelker wrote:
That's why the *-testsuite is a subpackage: the main package builds fine
with a certain set of tests/integrity, and the testsuite could pick whatever
is available: e.g. currently there's no valgrind for armv7l available
because
"nothing provides glibc < 2.28.0". I guess this one will go away in a
couple
of weeks. Meanwhile, I'd have to take out armv7l from the guards around
the BuildRequires:valgrind to get something tested at all, and I won't
be given a notice when it would be available again, so that I could take
it back in.

2 scenarios:

Run the valgrind tests only on x86 ? Iff the package doesn't have some arch
specific code and is all generic compiled for all arches, then running
valgrind on all of them doesn't give you anything except slow tests. You are
essentially testing the compiler at this point, not the application.

If you do have platform specific code, then it's a different argument of
course. Then you could have *-testsuite and *-valgrind-testsuite and run the
valgrind-only stuff in the valgrind scenario. And if the valgrind is
missing, then that should be OK too as you don't ship that binary.

I would also run these tests in the devel project or your home only, not in
actual Factory. That way you can keep track of them without having these
binaries in factory. You can use %bcond_with guards for the tests and use
project config to enable them.

If you just want to run the testsuite in your home or devel project (or a
specific testing project), you could do the following:

- create a new "coreutils-testsuite-deps" package
- add a "Recommends: valgrind", "Recommends: xyz" etc. to the package
- add a "BuildRequires: coreutils-testsuite-deps" line to the
coreutils-testsuite spec
- add a "Expandflags: dorecommends" to your project config

Now, if you build the coreutils-testsuite package, the valgrind package will
be installed if it is present and all its deps etc. can be satisfied.

But if you do it this way, you will _NEVER_ run the full testsuite in the
openSUSE:Factory project (since recommends are ignored during expansion).
Hence, I'm not sure if this "hack" works for you...


Marcus
--
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-packaging+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups