Skip to content

Comments

[ty] cargo insta test --force-update-snapshots#22313

Merged
oconnor663 merged 2 commits intomainfrom
cargo-insta-force-update
Jan 5, 2026
Merged

[ty] cargo insta test --force-update-snapshots#22313
oconnor663 merged 2 commits intomainfrom
cargo-insta-force-update

Conversation

@oconnor663
Copy link
Contributor

Snapshot tests recently started reporting this warning:

Snapshot test passes but the existing value is in a legacy format.
Please run cargo insta test --force-update-snapshots to update to a
newer format.

This PR is the result of that forced update.

One file (crates/ruff_db/src/diagnostic/render/full.rs) seems to get corrupted, because it contains strings with unprintable characters that trigger some bug in cargo-insta. I've manually reverted that file, but kept everything else.

Snapshot tests recently started reporting this warning:

> Snapshot test passes but the existing value is in a legacy format.
> Please run cargo insta test --force-update-snapshots to update to a
> newer format.

This PR is the result of that forced update.

One file (crates/ruff_db/src/diagnostic/render/full.rs) seems to get
corrupted, because it contains strings with unprintable characters that
trigger some bug in cargo-insta. I've manually reverted that file, but
kept everything else.
@AlexWaygood AlexWaygood added the testing Related to testing Ruff itself label Dec 30, 2025
@astral-sh-bot
Copy link

astral-sh-bot bot commented Dec 30, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@@ -1,7 +1,5 @@
---
source: crates/ruff_python_formatter/tests/fixtures.rs
input_file: crates/ruff_python_formatter/resources/test/fixtures/black/cases/fmtskip5.py
Copy link
Member

@MichaReiser MichaReiser Dec 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, why did it remove all the input files. I would very much like to retain this information in some form or another as it is very convenient to navigate to the test file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this added by insta::glob and not added by datatest? Just a guess

@AlexWaygood
Copy link
Member

It would be nice to merge a solution to the warnings soon, because the warnings are extremely noisy when running tests for ty locally right now

@oconnor663
Copy link
Contributor Author

I couldn't figure out a clever way to restore all the input_file lines, so I just had Claude do it :) I can confirm that all the "legacy format" warnings from main are still gone if I run cargo insta test.

@oconnor663
Copy link
Contributor Author

For context, when I looked into why exactly these legacy format warnings were printing, at least some of them were because the old snapshots were only equal to current output after trimming leading newlines. Specifically:

@oconnor663 oconnor663 merged commit 4712503 into main Jan 5, 2026
44 checks passed
@oconnor663 oconnor663 deleted the cargo-insta-force-update branch January 5, 2026 15:55
sharkdp added a commit that referenced this pull request Feb 16, 2026
## Summary

Force-update insta snapshots across all ty crates. Seems like those are
maybe from old PRs that were merged after
#22313?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Related to testing Ruff itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants