Skip to content

Commit

Permalink
Filter uv version display in standard filters (#4403)
Browse files Browse the repository at this point in the history
No reason for these to be special-cased and I need them for #4404 tests
  • Loading branch information
zanieb committed Jun 19, 2024
1 parent 2b74d13 commit 0db5ce0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 24 deletions.
26 changes: 2 additions & 24 deletions crates/uv/tests/cache_prune.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,7 @@ fn prune_no_op() -> Result<()> {
.assert()
.success();

let filters: Vec<_> = context
.filters()
.into_iter()
.chain([(
r"uv \d+\.\d+\.\d+( \(.*\))?",
r"uv [VERSION] ([COMMIT] DATE)",
)])
.collect();

uv_snapshot!(filters, prune_command(&context).arg("--verbose"), @r###"
uv_snapshot!(context.filters(), prune_command(&context).arg("--verbose"), @r###"
success: true
exit_code: 0
----- stdout -----
Expand Down Expand Up @@ -109,16 +100,7 @@ fn prune_stale_directory() -> Result<()> {
let simple = context.cache_dir.child("simple-v4");
simple.create_dir_all()?;

let filters: Vec<_> = context
.filters()
.into_iter()
.chain([(
r"uv \d+\.\d+\.\d+( \(.*\))?",
r"uv [VERSION] ([COMMIT] DATE)",
)])
.collect();

uv_snapshot!(filters, prune_command(&context).arg("--verbose"), @r###"
uv_snapshot!(context.filters(), prune_command(&context).arg("--verbose"), @r###"
success: true
exit_code: 0
----- stdout -----
Expand Down Expand Up @@ -155,10 +137,6 @@ fn prune_stale_symlink() -> Result<()> {
.filters()
.into_iter()
.chain([
(
r"uv \d+\.\d+\.\d+( \(.*\))?",
r"uv [VERSION] ([COMMIT] DATE)",
),
// The cache entry does not have a stable key, so we filter it out
(
r"\[CACHE_DIR\](\\|\/)(.+)(\\|\/).*",
Expand Down
5 changes: 5 additions & 0 deletions crates/uv/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ pub const INSTA_FILTERS: &[(&str, &str)] = &[
// Rewrite Windows output to Unix output
(r"\\([\w\d])", "/$1"),
(r"uv.exe", "uv"),
// uv version display
(
r"uv \d+\.\d+\.\d+( \(.*\))?",
r"uv [VERSION] ([COMMIT] DATE)",
),
// The exact message is host language dependent
(
r"Caused by: .* \(os error 2\)",
Expand Down

0 comments on commit 0db5ce0

Please sign in to comment.