-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Always test against a copy of the testdata. This should avoid problems with the testdata being trimmed out by `cargo publish`.
On macOS the tempdir goes through a symlink so paths may not appear the same: canonicalize before comparing.
Get copy symlinks on WIndows, since that's now used in copying some testdata
Mostly guards against mutating it to . but seems like something that we expect should always be true, anyhow.
Unlikely to ever be a practical problem here
sourcefrog
changed the title
Rename testdata Cargo.toml to Cargo_test.toml
Allow tests to pass in published tarballs
Oct 13, 2024
cargo package excludes it
sourcefrog
force-pushed
the
355-testdata-toml
branch
from
October 13, 2024 02:49
218ef1c
to
7abd2ee
Compare
sourcefrog
changed the title
Allow tests to pass in published tarballs
Tests pass in cargo-mutants crate tarballs
Oct 13, 2024
cc @jelmer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.