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

feat: update insta inline snapshot when clicking 'Update Test' runnable #19197

Merged
merged 2 commits into from
Feb 24, 2025

Conversation

andylokandy
Copy link
Contributor

@andylokandy andylokandy commented Feb 21, 2025

The 'Update Test' runnable was implemented in PR #18757.

It was found that the insta snapshot library does not update inline snapshots using the 'Update Test' runnable because it only sets the environment variable INSTA_UPDATE=always which does not affect inline snapshots.

insta supports updating snapshots using cargo-nextest, which run each test in a single process, requiring the external tool cargo-insta to collect diffs and apply changes. Thus, updating inline snapshots with plain cargo test is not feasible(insta #490).

This PR changes the 'Update Test' runnables to use cargo insta test instead of cargo test ... when the test involves insta. This change is justified since cargo insta test is compatible with other snapshot libraries and it is assumed that insta users have cargo-insta installed.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 21, 2025
@andylokandy andylokandy changed the title feat: update insta inline snapshot when clicks 'Update Test' runnable feat: update insta inline snapshot when clicking 'Update Test' runnable Feb 21, 2025
@Veykril Veykril added this pull request to the merge queue Feb 24, 2025
Copy link
Member

@Veykril Veykril left a comment

Choose a reason for hiding this comment

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

Sounds reasonable, thanks!

Merged via the queue into rust-lang:master with commit f63f845 Feb 24, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants