Skip to content

Tests pass in cargo-mutants crate tarballs#422

Merged
sourcefrog merged 27 commits intomainfrom
355-testdata-toml
Oct 13, 2024
Merged

Tests pass in cargo-mutants crate tarballs#422
sourcefrog merged 27 commits intomainfrom
355-testdata-toml

Conversation

@sourcefrog
Copy link
Owner

@sourcefrog sourcefrog commented Oct 5, 2024

Always test against a copy of the testdata.

This should avoid problems with the testdata being trimmed out by cargo publish.

The motivation is that Debian, or others who package from the tarball, can run the tests after building.

Most of the changes in this are connected to cargo publish behavior of excluding various files including symlinks, Cargo.toml, and .cargo. This PR renames them and recreates them during the test, in the process of copying the testdata to a temporary directory. Aside from anything else this should make sure that each test is hermetic.

Also, since we're now creating the symlink from a test, we can also do that on Windows and check that it works.

This also adds a CI job that checks that the tests do pass in an unpacked tarball.

Also, delete a lot of Insta snapshots that had accumulated and are no longer needed.

Always test against a copy of the testdata.

This should avoid problems with the testdata being trimmed out by `cargo
publish`.
@sourcefrog sourcefrog changed the title Rename testdata Cargo.toml to Cargo_test.toml Allow tests to pass in published tarballs Oct 13, 2024
@sourcefrog sourcefrog changed the title Allow tests to pass in published tarballs Tests pass in cargo-mutants crate tarballs Oct 13, 2024
@sourcefrog sourcefrog marked this pull request as ready for review October 13, 2024 15:21
@sourcefrog
Copy link
Owner Author

cc @jelmer

@sourcefrog sourcefrog merged commit d9e9c0b into main Oct 13, 2024
@sourcefrog sourcefrog deleted the 355-testdata-toml branch October 13, 2024 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant