[aur-general] Customize testing in PKGBUILD
Hi, I'm maintaining the eccodes aur package and would like to enable some extra tests in PKGBUILD. This can be done by downloading extra testdata and put that into the main build dir. As good as this may seem, it significantly blows up the build time of the package. So I thought about somehow let the user decide whether to run those expensive extra tests at build. Unfortunately I could not find a recommended way of doing so. Would it be an option to check an environment variable, call it ENABLE_EXTRA_TESTS or so, and run those stuff only if set? And otherwise just run the usual tests without the extra data? Any thoughts? Thanks! -- MfG Jan
Hey, Most use env vars or sourcing of extra files during build for this kind of purpose. For env vars the only downside is that they are not preserved in chroot see: https://bugs.archlinux.org/task/44827 For linux-pf I use this and add the to the sources of the packages: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=linux-pf#n151 https://aur.archlinux.org/cgit/aur.git/tree/build_pkgs?h=linux-pf#n9 rpmbuild has some --with and --without options to do stuff like you suggest maybe something like this would be useful too. Br, Björn
On 21-12-14 00:07, Jan Kohnert via aur-general wrote:
Hi,
I'm maintaining the eccodes aur package and would like to enable some extra tests in PKGBUILD. This can be done by downloading extra testdata and put that into the main build dir. As good as this may seem, it significantly blows up the build time of the package.
So I thought about somehow let the user decide whether to run those expensive extra tests at build. Unfortunately I could not find a recommended way of doing so.
Would it be an option to check an environment variable, call it ENABLE_EXTRA_TESTS or so, and run those stuff only if set? And otherwise just run the usual tests without the extra data?
Any thoughts?
Thanks!
-- MfG Jan
From a packaging perspective, I run all tests that I can get my hands on. Users can then decide whether or not to enable or disable tests completely. There really isn't much of a middle ground. -- George Rawlinson
On 2021-12-14 06:45, George Rawlinson via aur-general wrote:
On 21-12-14 00:07, Jan Kohnert via aur-general wrote:
Hi,
I'm maintaining the eccodes aur package and would like to enable some extra tests in PKGBUILD. This can be done by downloading extra testdata and put that into the main build dir. As good as this may seem, it significantly blows up the build time of the package.
So I thought about somehow let the user decide whether to run those expensive extra tests at build. Unfortunately I could not find a recommended way of doing so.
Would it be an option to check an environment variable, call it ENABLE_EXTRA_TESTS or so, and run those stuff only if set? And otherwise just run the usual tests without the extra data?
Any thoughts?
Thanks!
-- MfG Jan
From a packaging perspective, I run all tests that I can get my hands on. Users can then decide whether or not to enable or disable tests completely. There really isn't much of a middle ground.
+1 Users are expected/encouraged to read the PKGBUILD before they run "makepkg". They are already empowered to skip the tests if they want; There's no reason to complicate it further.
Just put the tests in. Download the sources in the source array, do whatever you need to do in prepare() to get them where they belong relative to the other sources, and have a check() function by default. If there are tests, having a check() function that runs them is almost always the right default behavior for a PKGBULID. For people that want faster build times and don't care about tests, they already have a solution: the /etc/makepkg.conf file can be edited to add !check to the BUILDENV array. This will suppress the test suites for all builds for that extra speed. Caleb On 2021-12-14 02:07, Jan Kohnert via aur-general wrote:
Hi,
I'm maintaining the eccodes aur package and would like to enable some extra tests in PKGBUILD. This can be done by downloading extra testdata and put that into the main build dir. As good as this may seem, it significantly blows up the build time of the package.
So I thought about somehow let the user decide whether to run those expensive extra tests at build. Unfortunately I could not find a recommended way of doing so.
Would it be an option to check an environment variable, call it ENABLE_EXTRA_TESTS or so, and run those stuff only if set? And otherwise just run the usual tests without the extra data?
Any thoughts?
Thanks!
Hi again, Am Dienstag, 14. Dezember 2021, 00:07:46 CET schrieb Jan Kohnert via aur- general:
So I thought about somehow let the user decide whether to run those expensive extra tests at build. Unfortunately I could not find a recommended way of doing so.
Would it be an option to check an environment variable, call it ENABLE_EXTRA_TESTS or so, and run those stuff only if set? And otherwise just run the usual tests without the extra data?
so most of you wrote in favour of enabling all tests by default and not use some sort of mechanism to somehow enable extra tests. So be it. Thank your all! -- MfG Jan
participants (5)
-
Bjoern Bidar
-
Brett Cornwall
-
Caleb Maclennan
-
George Rawlinson
-
Jan Kohnert