mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
fix(test): Redact elapsed time in the minutes time frame
This came up in #14231 ``` ---- expected: tests/testsuite/lto.rs:611:27 ++++ actual: stderr 1 1 | [FRESH] registry-shared v0.0.1 2 2 | [FRESH] registry v0.0.1 3 3 | [COMPILING] bar v0.0.0 ([ROOT]/foo/bar) 4 4 | [RUNNING] `rustc --crate-name bar [..]-C lto [..]--test [..]` 5 5 | [RUNNING] `rustc --crate-name b [..]-C lto [..]--test [..]` 6 - [FINISHED] `release` profile [optimized] target(s) in [ELAPSED]s 7 6 | [RUNNING] `[ROOT]/foo/target/release/deps/bar-[HASH][EXE]` 8 7 | [RUNNING] `[ROOT]/foo/target/release/deps/b-[HASH][EXE]` 9 8 | [DOCTEST] bar 10 9 | [RUNNING] `rustdoc --edition=2015 --crate-type cdylib --crate-type rlib --crate-name bar --test [..]-C lto [..] 10 + [FINISHED] `release` profile [optimized] target(s) in 1m 00s Update with SNAPSHOTS=overwrite ```
This commit is contained in:
parent
5ed63926d3
commit
7fcd580b3b
@ -161,19 +161,19 @@ fn add_regex_redactions(subs: &mut snapbox::Redactions) {
|
||||
// For e2e tests
|
||||
subs.insert(
|
||||
"[ELAPSED]",
|
||||
regex!(r"\[FINISHED\].*in (?<redacted>[0-9]+(\.[0-9]+))s"),
|
||||
regex!(r"\[FINISHED\].*in (?<redacted>[0-9]+(\.[0-9]+)?(m [0-9]+)?)s"),
|
||||
)
|
||||
.unwrap();
|
||||
// for UI tests
|
||||
subs.insert(
|
||||
"[ELAPSED]",
|
||||
regex!(r"Finished.*in (?<redacted>[0-9]+(\.[0-9]+))s"),
|
||||
regex!(r"Finished.*in (?<redacted>[0-9]+(\.[0-9]+)?(m [0-9]+)?)s"),
|
||||
)
|
||||
.unwrap();
|
||||
// output from libtest
|
||||
subs.insert(
|
||||
"[ELAPSED]",
|
||||
regex!(r"; finished in (?<redacted>[0-9]+(\.[0-9]+))s"),
|
||||
regex!(r"; finished in (?<redacted>[0-9]+(\.[0-9]+)?(m [0-9]+)?)s"),
|
||||
)
|
||||
.unwrap();
|
||||
subs.insert(
|
||||
@ -976,7 +976,7 @@ B", false,
|
||||
);
|
||||
assert_data_eq!(
|
||||
subs.redact("[FINISHED] `release` profile [optimized] target(s) in 1m 05s"),
|
||||
str!["[FINISHED] `release` profile [optimized] target(s) in 1m 05s"].raw()
|
||||
str!["[FINISHED] `release` profile [optimized] target(s) in [ELAPSED]s"].raw()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user