[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Adding an optional dependency for test suite



Hi,

Quoting Loren M. Lang (2024-02-01 04:08:59)
> I have a package

which package is that?

> which has an extensive test suite that relies on using docker/podman to
> create a container for it's test runner and mounts the build tree read-only
> inside it.

Why does it need docker/podman isolation to run tests?

> If docker or podman is found at the time of configure, it will include a
> check target to run the full suite and dh_auto_test will automatically invoke
> it as part of the binary package build. Otherwise, it is just skipped with a
> message and builds without running any tests.
> 
> When I run dpkg-buildpage to build locally, I get the test suite as I
> have it installed, but when I build with pbuilder or schroot, the tests
> get skipped. Should I add a build-depenency on podman or is there some
> mechanism to make it optional?

Even if you have podman/docker installed at build time, it will still fail
because you do not have the required image downloaded, no? You must not let
your package access the internet during the build (including the tests) so
downloading an appropriate image from somewhere to make tests work is not an
option.

> I suppose I could just try adding the package to my referenec images so it's
> there when I build inside a chroot(), but does buildd normally try to run
> test suites when available after a new source package is uploaded? Or it that
> not normally done on the build server?

The buildds run tests, yes.

I think another question is what kind of tests those are. Are they tests for
the developers which they use to make sure that new commits do not introduce
regressions and the package is fit for release? Or are they tests that maybe
can/should be converted into an autopkgtest which checks whether your package
works as expected when installed? If you convert your build-time tests to
run-time autopkgtests, you have a couple of more options of what you can do.

Thanks!

cheers, josch

Attachment: signature.asc
Description: signature


Reply to: