Skip to content

Tests fail in unpacked crates.io crate tarball, due to missing testdata #355

@sourcefrog

Description

@sourcefrog

Debian seems to build and run tests from the package uploaded to crates.io, which is reasonable enough. At the moment I exclude the testdata but this is a good reason not to. Anyhow, crates.io provides a kind of supplementary archive of the history of the project so it would be good if it's complete.

That would allow dropping https://sources.debian.org/patches/rust-cargo-mutants/23.10.0-1/disable-tests-missing-testdata.patch/

(cc @jelmer who seems to have kindly packaged, including finding this workaround, and uploaded it.)

However, this is more tricky than I expected because most of the testdata is comprised of example Rust trees and

https://doc.rust-lang.org/cargo/reference/manifest.html#the-exclude-and-include-fields:

Regardless of whether exclude or include is specified, the following files are always excluded:

  • Any sub-packages will be skipped (any subdirectory that contains a Cargo.toml file).

We could somehow hide the testdata from cargo-package (e.g. renaming the files) but that seems like it would make development on the tree less straightforward.

We could potentially add a feature flag or other mechanism to let the tests pass if testdata is missing, and test from CI that this work.

Overall I'm not sure there's any much better option than manually cutting out the tests.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions