Skip to content

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

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

oconnor663 merged 2 commits into
mainfrom
cargo-insta-force-update

Conversation

@oconnor663

Copy link
Copy Markdown
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 or ty label Dec 30, 2025
@astral-sh-bot

astral-sh-bot Bot commented Dec 30, 2025 •

Copy link
Copy Markdown

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

@MichaReiser MichaReiser Dec 31, 2025 •

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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?
KotlinIsland pushed a commit to KotlinIsland/basedpython that referenced this pull request May 1, 2026
## Summary

Force-update insta snapshots across all ty crates. Seems like those are
maybe from old PRs that were merged after
astral-sh/ruff#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 or ty

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants