Discussion:
Debian CI and autopkgtest artifacts
Add Reply
Daniel Markstedt
2024-10-26 21:50:01 UTC
Reply
Permalink
Hi all,

The autopkgtest docs suggest that by putting a file in a particular directory would have it picked up as a test artifact for the CI job.

Since Debian CI does provide a tarball with artifacts for each job, I was hoping that you could put an arbitrary artifact from a test run and have the system include it in the tarball.
The usecase is for storing the test log from a monolithic testsuite (written in C) that isn't tightly integrated with the test runner.

Would someone know where this dir would be, relative to the source dir?
According to the autopkgtest docs, it is defined by the $AUTOPKGTEST_ARTIFACTS env variable...

Thanks!

Daniel
Simon McVittie
2024-10-26 22:20:01 UTC
Reply
Permalink
Post by Daniel Markstedt
The autopkgtest docs suggest that by putting a file in a particular
directory would have it picked up as a test artifact for the CI job.
Yes. During your test, the name of that directory is given by the
environment variable AUTOPKGTEST_ARTIFACTS.
Post by Daniel Markstedt
Would someone know where this dir would be, relative to the source dir?
You cannot predict it ahead of time. The specification is that you need
to read the environment variable AUTOPKGTEST_ARTIFACTS during testing
to find out what the correct location is for this particular test run.

If you're running an upstream test suite that writes out artifacts in
some location of its choice, you can wrap it in a shell script (or a
Perl or Python script or whatever you prefer) that copies the upstream
test suite's artifacts from that location into $AUTOPKGTEST_ARTIFACTS
(for example see debian/tests/upstream-runtime-tests in the keyutils
source package).

Or if you're running a tool or an upstream test suite that can be told
to write logs or other artifacts to a particular location, you can wrap
it in a script that tells it to put artifacts in $AUTOPKGTEST_ARTIFACTS
(for example see debian/tests/installed-tests in the gtk4 source package).

smcv

Loading...