From 02459b707fcd638f3319f975ab98566df2b64382 Mon Sep 17 00:00:00 2001 From: Scott Schafer Date: Mon, 10 Jun 2024 12:21:06 -0600 Subject: [PATCH] test: Auto-redact bench timing results --- crates/cargo-test-support/src/compare.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/cargo-test-support/src/compare.rs b/crates/cargo-test-support/src/compare.rs index af9883952..1ccea27d6 100644 --- a/crates/cargo-test-support/src/compare.rs +++ b/crates/cargo-test-support/src/compare.rs @@ -178,6 +178,16 @@ fn add_common_redactions(subs: &mut snapbox::Redactions) { if let Some(alt_target) = try_alternate() { subs.insert("[ALT_TARGET]", alt_target).unwrap(); } + subs.insert( + "[AVG_ELAPSED]", + regex!("(?[0-9]+(\\.[0-9]+)?) ns/iter"), + ) + .unwrap(); + subs.insert( + "[JITTER]", + regex!("ns/iter \\(\\+/- (?[0-9]+(\\.[0-9]+)?)\\)"), + ) + .unwrap(); } static MIN_LITERAL_REDACTIONS: &[(&str, &str)] = &[