Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests pass in cargo-mutants crate tarballs #422

Merged
merged 27 commits into from
Oct 13, 2024
Merged

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
29 checks passed
@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