test(rustfix): Use snapbox for snapshot testing#15429
Merged
weihanglo merged 3 commits intorust-lang:masterfrom Apr 14, 2025
Merged
test(rustfix): Use snapbox for snapshot testing#15429weihanglo merged 3 commits intorust-lang:masterfrom
snapbox for snapshot testing#15429weihanglo merged 3 commits intorust-lang:masterfrom
Conversation
Collaborator
079c5f2 to
07b5413
Compare
snapbox and #[cargo_test] for snapshot testing
weihanglo
reviewed
Apr 13, 2025
`.json` files will have pretty printed json when updated
Contributor
Author
|
The test |
snapbox and #[cargo_test] for snapshot testingsnapbox or snapshot testing
snapbox or snapshot testingsnapbox for snapshot testing
Member
That sounds good to me. Could you help do it in an extra commit? |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Apr 17, 2025
Update cargo 4 commits in 864f74d4eadcaea3eeda37a2e7f4d34de233d51e..d811228b14ae2707323f37346aee3f4147e247e6 2025-04-11 20:37:27 +0000 to 2025-04-15 15:18:42 +0000 - use `zlib-rs` for gzip compression in rust code (rust-lang/cargo#15417) - test(rustfix): Use `snapbox` for snapshot testing (rust-lang/cargo#15429) - chore(deps): update rust crate gix to 0.71.0 [security] (rust-lang/cargo#15391) - Make sure search paths inside OUT_DIR precede external paths (rust-lang/cargo#15221) Also, * The license exception of sha1_smol with BSD-3-Clause is no longer needed, as `gix-*` doesn't depend on it. * Cargo depends on zlib-rs, which is distributed under Zlib license r? ghost
github-actions bot
pushed a commit
to rust-lang/rustc-dev-guide
that referenced
this pull request
Apr 19, 2025
Update cargo 4 commits in 864f74d4eadcaea3eeda37a2e7f4d34de233d51e..d811228b14ae2707323f37346aee3f4147e247e6 2025-04-11 20:37:27 +0000 to 2025-04-15 15:18:42 +0000 - use `zlib-rs` for gzip compression in rust code (rust-lang/cargo#15417) - test(rustfix): Use `snapbox` for snapshot testing (rust-lang/cargo#15429) - chore(deps): update rust crate gix to 0.71.0 [security] (rust-lang/cargo#15391) - Make sure search paths inside OUT_DIR precede external paths (rust-lang/cargo#15221) Also, * The license exception of sha1_smol with BSD-3-Clause is no longer needed, as `gix-*` doesn't depend on it. * Cargo depends on zlib-rs, which is distributed under Zlib license r? ghost
This file contains hidden or 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
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.
What does this PR try to resolve?
snapboxis used to test the snapshots.jsonfile alone should never cause a test to fail.jsonfiles updated only if expected fix != actual fix &&SNAPSHOTS=overwrite.jsonfiles are updated, the json is pretty printedRUSTFIX_TEST_*for overwriting test snapshots withSNAPSHOTS=overwriteRUSTFIX_TEST_RECORD_FIXED_RUSTfeature is removed (generate a*.fixed.rson demand`). We can add it back whenever needed.Fixes #13891
How should we test and review this PR?
Run tests with:
cargo test -p rustfixAll the test should run as different test cases
nightly tests run only when using nightly version of rustc is used