From bcdadd418a4a129c13d34c3d080f30a562f1f5cf Mon Sep 17 00:00:00 2001 From: Zanie Date: Wed, 20 Dec 2023 12:22:32 -0600 Subject: [PATCH] Exclude the number of cleared cache entries from the snapshot --- crates/puffin-cli/tests/pip_sync.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/puffin-cli/tests/pip_sync.rs b/crates/puffin-cli/tests/pip_sync.rs index 0897b6716..b49e09e10 100644 --- a/crates/puffin-cli/tests/pip_sync.rs +++ b/crates/puffin-cli/tests/pip_sync.rs @@ -1479,8 +1479,14 @@ fn install_registry_source_dist_cached() -> Result<()> { let parent = assert_fs::TempDir::new()?; let venv = create_venv_py312(&parent, &cache_dir); + let mut clean_filters = INSTA_FILTERS.to_vec().clone(); + + // We allow the number of entries to vary, as the cache count is different when using + // a local index mirror + clean_filters.push((r"Cleared \d (entry|entries) for", "Cleared [N] entries for")); + insta::with_settings!({ - filters => INSTA_FILTERS.to_vec() + filters => clean_filters }, { assert_cmd_snapshot!(Command::new(get_cargo_bin(BIN_NAME)) .arg("clean") @@ -1494,7 +1500,7 @@ fn install_registry_source_dist_cached() -> Result<()> { ----- stdout ----- ----- stderr ----- - Cleared 2 entries for package: future + Cleared [N] entries for package: future "###); });