Skip to content

Commit

Permalink
add redactions for total checks and filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
suaviloquence committed Aug 16, 2024
1 parent eb5c87d commit 60aa9c9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/snapshot_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ fn assert_integration_test(test_name: &str, invocation: &[&str]) {
settings.set_snapshot_path("../test_outputs/snapshot_tests");
// Turn dynamic time strings like [ 0.123s] into [TIME] for reproducibility.
settings.add_filter(r"\[\s*[\d\.]+s\]", "[TIME]");
// Turn total number of checks into [TOTAL] to not fail when new lints are added.
settings.add_filter(r"\d+ checks", "[TOTAL] checks");
// Similarly, turn the number of passed checks to also not fail when new lints are added.
settings.add_filter(r"\d+ pass", "[PASS] pass");
// Redact filenames in spans when lints are triggered.
settings.add_filter(r"in file [^:]+:", "in file [PATH]:");

// The `settings` are applied to the current thread as long as the returned
// drop guard `_grd` is alive, so we use a `let` binding to keep it alive
Expand Down

0 comments on commit 60aa9c9

Please sign in to comment.