#964077 Fix build-time and autopkg tests

#964077#5
Date:
2020-07-01 09:35:14 UTC
From:
To:
Hi,
I was looking at liburing and appreciate the overall high packaging quality.
But in regard to build time and autopkgtests I found that these always
failed.
I've taken a look at that as I'd love to get some actual test coverage onto
liburing in Debian&Ubuntu.

It turns out the changes are not too hard and hereby provided in individual
commits (attachments).

Unfortunately the packaging git [1] has no UI for pull requests, so I had
to provide patches. The attachments are in git format-patch style.

- 0001-d-rules-build-time-tests-require-root.patch
- 0002-d-t-control-mark-unit-tests-to-need-root-and-a-VM.patch
- 0003-d-t-test-build-io_uring-link-no-more-exists-as-examp.patch
- 0004-d-p-disable-known-failures.patch-disable-tests-known.patch
- 0005-d-rules-test-succeed-now-stop-passing-true.patch

If you want to pull a branch instead feel free to fetch [2].

I'll furthermore attach logs of root/non-root builds as well as autopkgtest
runs to prove that with these changes the tests now work.

- liburing-tests-build-time.txt
- liburing-tests-build-time-no-root.txt
- liburing-tests-autopkgtest.txt

Note, the tests at build and at autopkgtest time are mostly the same.
Therefore I've kept "Rules-Requires-Root: no" in d/control which means it
will
in most cases not test at build time (unless you e.g. sudo sbuild ...). But
since the same tests will run at autopkgtest that is ok for me, if you
want/need build time checks please change R³ to yes and they will work.

I have eventually done a cross-arch build [3] and test [4] on Ubuntu to see
how !x86 behaves now that the tests work on x86. Depending on the outcome
of this we might disable a few more tests maybe, but they are still
running? Since CI so far considers these always-failed we can go on as-is,
since in the worst case non-x86 will stay that way until we further improve.

[1]: https://git.hadrons.org/cgit/debian/pkgs/liburing.git
[2]:
https://code.launchpad.net/~paelzer/ubuntu/+source/liburing/+git/liburing/+ref/improve-self-tests-Debian
[3]:
https://launchpad.net/~ci-train-ppa-service/+archive/ubuntu/4129/+packages
[4]: https://bileto.ubuntu.com/excuses/4129/groovy.html


P.S. unfortunately the packaging repo doesn't contain the actual liburing
source. Due to that I had to always ex/import from this repo onto a
directory actually having the liburing source - is there any reason not to
package it "as usual" with the source as in orig tarball present as well?

P.P.S. 9 (small) attachments, I hope bugs.debian can handle that ...

#964077#10
Date:
2020-07-14 05:54:42 UTC
From:
To:
Testing across more test environments showed that the link tests will fail
in containers.
To not throw away the other tests in those environments via e.g. a
restriction to only run in VMs I decided to just skip the link tests in
this case. Here is the patch that would go on top of the others I already
reported.

#964077#15
Date:
2020-07-14 12:43:57 UTC
From:
To:
Another patch on top (since you didn't commit any you can squash that with
the former one).
If not using fakeroot it needs to use DEB_RULES_REQUIRES_ROOT.

Patch attached

#964077#20
Date:
2021-09-18 21:49:36 UTC
From:
To:
Hi!

Yeah me too, and I've been fixing these upstream to try to get there. But
unfortunately these tests are highly kernel version dependent, and new
ones tend to have very recent kernel requirements.

The various architectures supported in Debian have wildly different
support and kernel versions in the buildds. So I don't find it
realistic to enforce them right now, TBH.

I still want to run them to be able to check the results from time to
time, though.

Yeah, I'd rather not require root for building.

See above, this does not seem realistic in Debian. :/

I find the workflow of keeping the upstream sources in the packaging
repos to be wrong-headed, and very confusing for people that are not
into Debian packaging. I've written about this elsewhere but probably
need to create a wiki page or similar to point to people that might be
curious why. :)

Thanks, in 0.7-1, I reworked the autopkgtest to use a loop and fixed
this by renaming the example name.

So thanks for all the patches, although as it is now, I think I'm
unlikely to pull in the rest of the patches, given that this is currently
going to be a major burden until uring support stabilizes in the kernel
for all arches. Perhaps I'll add one autopkgtest running as root though,
but that's probably it.

Thanks,
Guillem