#980723 debcargo-built binary crates have no way to run upstream tests

Package:
debcargo
Source:
rust-debcargo
Description:
Create a Debian package from a Cargo crate
Submitter:
Daniel Kahn Gillmor
Date:
2021-01-21 22:39:04 UTC
Severity:
normal
#980723#5
Date:
2021-01-21 01:14:45 UTC
From:
To:
Looks like the autopkgtests are not being run for rust-sequoia-sqv (or
for sq-keyring-linter or sqop).  I think this is because some rust
packages needed specifically for testing are not available in the
archive.

We should add them to the archive so that the autopkgtest suites get
run.  (they do not appear to be run during the build)

#980723#10
Date:
2021-01-21 07:43:29 UTC
From:
To:
That starts with identifing those missing packages.



Regards
Geert Stappers
Moral support on this issue.

#980723#15
Date:
2021-01-21 22:32:04 UTC
From:
To:
Control: reassign 980723 debcargo
Control: retitle 980723 debcargo-built binary crates have no way to run upstream tests
Control: affects 980723 + rust-sequoia-sqv rust-sequoia-sop rust-sequoia-keyring-linter

Hm, on further investigation, i think it is actually because the
debcargo-based packaging workflow just doesn't run cargo's tests on
binary-only crates.

The upstream tests associated with "cargo test" aren't run during the
build (dh_auto_test) on any crate, fwict, but they *are* run during the
autopkgtest.

I'm glad that they're run during autopkgtest because that means that
they can be re-run without a package rebuild when new versions of
dependencies are uploaded.

But, binary-only crates don't file any rust source in
/usr/share/cargo/registry/ so running (for example)

     /usr/share/cargo/bin/cargo-auto-test sequoia-sop 0.22.0

from an unpacked rust-sequoia-sop source tree just yields:

     crate directory not found: /usr/share/cargo/registry/sequoia-sop-0.22.0

so they aren't run in autopkgtest for binary-only crates.

I think we might need to rethink how debcargo handles the upstream tests
for binary-only crates.  Perhaps the dh --buildsystem cargo needs to
adjust how that's done?

weirdly, i note that rust-sequoia-sop 0.22 has these two lines in
debian/rules:

    override_dh_auto_test:
            dh_auto_test -- test --all

but rust-sequoia-sqv 1.0.0 does not.

Both source packages are assembled with debcargo 2.4.3, i think, and
their debcargo.toml files don't differ meaningfully.