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

Migrate away from ad-hoc snapshot testing for rustfix test suite #13891

Open
weihanglo opened this issue May 9, 2024 · 0 comments
Open

Migrate away from ad-hoc snapshot testing for rustfix test suite #13891

weihanglo opened this issue May 9, 2024 · 0 comments
Labels
A-testing-cargo-itself Area: cargo's tests C-cleanup Category: cleanup within the codebase Command-fix E-easy Experience: Easy P-low Priority: Low S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review

Comments

@weihanglo
Copy link
Member

Problem

When dealing with rustfix snapshot test fixes, I found it a bit cumbersome to figure out the actual failure. You need to pass RUST_LOG=parse_and_replace=info to see the log, and RUSTFIX_TEST_BLESS=test-name.rs to update snapshots.

Proposed Solution

In the main Cargo crate, we've already integrated snapbox for UI tests. We could migrate rustfix test suite to that, and maybe share some common infra, like nightly channel detection from cargo-test-macro.

Notes

ehuss has a proposal that we don't run rustc if JSON snapshot exists: #13890 (comment).
This could be a good enhancement, and I think we can leave it to follow-ups.

@weihanglo weihanglo added C-cleanup Category: cleanup within the codebase A-testing-cargo-itself Area: cargo's tests S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review Command-fix E-easy Experience: Easy P-low Priority: Low labels May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testing-cargo-itself Area: cargo's tests C-cleanup Category: cleanup within the codebase Command-fix E-easy Experience: Easy P-low Priority: Low S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review
Projects
None yet
Development

No branches or pull requests

1 participant