From 12920f2a4f3f3613233801c858ce9cae214fb03b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Lecrenier?= Date: Wed, 10 Aug 2022 12:10:45 +0200 Subject: [PATCH] Fix paths of snapshot tests --- milli/src/snapshot_tests.rs | 7 ++++--- .../default/facet_id_f64_docids.hash.snap | 0 .../facet_id_f64_docids.hash.snap | 0 .../facet_id_f64_docids.hash.snap | 0 .../facet_id_f64_docids.hash.snap | 0 .../facet_id_f64_docids.hash.snap | 0 .../tiny_groups_tiny_levels/facet_id_f64_docids.hash.snap | 0 .../default/facet_id_string_docids.hash.snap | 0 .../facet_id_string_docids.hash.snap | 0 .../initial/word_prefix_pair_proximity_docids.snap | 0 .../update/word_prefix_pair_proximity_docids.snap | 0 11 files changed, 4 insertions(+), 3 deletions(-) rename milli/src/update/snapshots/{update => }/facets.rs/test_facets_number/default/facet_id_f64_docids.hash.snap (100%) rename milli/src/update/snapshots/{update => }/facets.rs/test_facets_number/large_groups_large_levels/facet_id_f64_docids.hash.snap (100%) rename milli/src/update/snapshots/{update => }/facets.rs/test_facets_number/large_groups_small_levels/facet_id_f64_docids.hash.snap (100%) rename milli/src/update/snapshots/{update => }/facets.rs/test_facets_number/small_groups_large_levels/facet_id_f64_docids.hash.snap (100%) rename milli/src/update/snapshots/{update => }/facets.rs/test_facets_number/small_groups_small_levels/facet_id_f64_docids.hash.snap (100%) rename milli/src/update/snapshots/{update => }/facets.rs/test_facets_number/tiny_groups_tiny_levels/facet_id_f64_docids.hash.snap (100%) rename milli/src/update/snapshots/{update => }/facets.rs/test_facets_string/default/facet_id_string_docids.hash.snap (100%) rename milli/src/update/snapshots/{update => }/facets.rs/test_facets_string/tiny_groups_tiny_levels/facet_id_string_docids.hash.snap (100%) rename milli/src/update/snapshots/{update => }/word_prefix_pair_proximity_docids.rs/test_update/initial/word_prefix_pair_proximity_docids.snap (100%) rename milli/src/update/snapshots/{update => }/word_prefix_pair_proximity_docids.rs/test_update/update/word_prefix_pair_proximity_docids.snap (100%) diff --git a/milli/src/snapshot_tests.rs b/milli/src/snapshot_tests.rs index 2b55a7e2c..c6e99a437 100644 --- a/milli/src/snapshot_tests.rs +++ b/milli/src/snapshot_tests.rs @@ -17,14 +17,15 @@ pub fn default_db_snapshot_settings_for_test(name: Option<&str>) -> insta::Setti let mut settings = insta::Settings::clone_current(); settings.set_prepend_module_to_snapshot(false); let path = Path::new(std::panic::Location::caller().file()); - let path = path.strip_prefix("milli/src").unwrap(); + let filename = path.file_name().unwrap().to_str().unwrap(); settings.set_omit_expression(true); let test_name = std::thread::current().name().unwrap().rsplit("::").next().unwrap().to_owned(); if let Some(name) = name { - settings.set_snapshot_path(Path::new("snapshots").join(path).join(test_name).join(name)); + settings + .set_snapshot_path(Path::new("snapshots").join(filename).join(test_name).join(name)); } else { - settings.set_snapshot_path(Path::new("snapshots").join(path).join(test_name)); + settings.set_snapshot_path(Path::new("snapshots").join(filename).join(test_name)); } settings diff --git a/milli/src/update/snapshots/update/facets.rs/test_facets_number/default/facet_id_f64_docids.hash.snap b/milli/src/update/snapshots/facets.rs/test_facets_number/default/facet_id_f64_docids.hash.snap similarity index 100% rename from milli/src/update/snapshots/update/facets.rs/test_facets_number/default/facet_id_f64_docids.hash.snap rename to milli/src/update/snapshots/facets.rs/test_facets_number/default/facet_id_f64_docids.hash.snap diff --git a/milli/src/update/snapshots/update/facets.rs/test_facets_number/large_groups_large_levels/facet_id_f64_docids.hash.snap b/milli/src/update/snapshots/facets.rs/test_facets_number/large_groups_large_levels/facet_id_f64_docids.hash.snap similarity index 100% rename from milli/src/update/snapshots/update/facets.rs/test_facets_number/large_groups_large_levels/facet_id_f64_docids.hash.snap rename to milli/src/update/snapshots/facets.rs/test_facets_number/large_groups_large_levels/facet_id_f64_docids.hash.snap diff --git a/milli/src/update/snapshots/update/facets.rs/test_facets_number/large_groups_small_levels/facet_id_f64_docids.hash.snap b/milli/src/update/snapshots/facets.rs/test_facets_number/large_groups_small_levels/facet_id_f64_docids.hash.snap similarity index 100% rename from milli/src/update/snapshots/update/facets.rs/test_facets_number/large_groups_small_levels/facet_id_f64_docids.hash.snap rename to milli/src/update/snapshots/facets.rs/test_facets_number/large_groups_small_levels/facet_id_f64_docids.hash.snap diff --git a/milli/src/update/snapshots/update/facets.rs/test_facets_number/small_groups_large_levels/facet_id_f64_docids.hash.snap b/milli/src/update/snapshots/facets.rs/test_facets_number/small_groups_large_levels/facet_id_f64_docids.hash.snap similarity index 100% rename from milli/src/update/snapshots/update/facets.rs/test_facets_number/small_groups_large_levels/facet_id_f64_docids.hash.snap rename to milli/src/update/snapshots/facets.rs/test_facets_number/small_groups_large_levels/facet_id_f64_docids.hash.snap diff --git a/milli/src/update/snapshots/update/facets.rs/test_facets_number/small_groups_small_levels/facet_id_f64_docids.hash.snap b/milli/src/update/snapshots/facets.rs/test_facets_number/small_groups_small_levels/facet_id_f64_docids.hash.snap similarity index 100% rename from milli/src/update/snapshots/update/facets.rs/test_facets_number/small_groups_small_levels/facet_id_f64_docids.hash.snap rename to milli/src/update/snapshots/facets.rs/test_facets_number/small_groups_small_levels/facet_id_f64_docids.hash.snap diff --git a/milli/src/update/snapshots/update/facets.rs/test_facets_number/tiny_groups_tiny_levels/facet_id_f64_docids.hash.snap b/milli/src/update/snapshots/facets.rs/test_facets_number/tiny_groups_tiny_levels/facet_id_f64_docids.hash.snap similarity index 100% rename from milli/src/update/snapshots/update/facets.rs/test_facets_number/tiny_groups_tiny_levels/facet_id_f64_docids.hash.snap rename to milli/src/update/snapshots/facets.rs/test_facets_number/tiny_groups_tiny_levels/facet_id_f64_docids.hash.snap diff --git a/milli/src/update/snapshots/update/facets.rs/test_facets_string/default/facet_id_string_docids.hash.snap b/milli/src/update/snapshots/facets.rs/test_facets_string/default/facet_id_string_docids.hash.snap similarity index 100% rename from milli/src/update/snapshots/update/facets.rs/test_facets_string/default/facet_id_string_docids.hash.snap rename to milli/src/update/snapshots/facets.rs/test_facets_string/default/facet_id_string_docids.hash.snap diff --git a/milli/src/update/snapshots/update/facets.rs/test_facets_string/tiny_groups_tiny_levels/facet_id_string_docids.hash.snap b/milli/src/update/snapshots/facets.rs/test_facets_string/tiny_groups_tiny_levels/facet_id_string_docids.hash.snap similarity index 100% rename from milli/src/update/snapshots/update/facets.rs/test_facets_string/tiny_groups_tiny_levels/facet_id_string_docids.hash.snap rename to milli/src/update/snapshots/facets.rs/test_facets_string/tiny_groups_tiny_levels/facet_id_string_docids.hash.snap diff --git a/milli/src/update/snapshots/update/word_prefix_pair_proximity_docids.rs/test_update/initial/word_prefix_pair_proximity_docids.snap b/milli/src/update/snapshots/word_prefix_pair_proximity_docids.rs/test_update/initial/word_prefix_pair_proximity_docids.snap similarity index 100% rename from milli/src/update/snapshots/update/word_prefix_pair_proximity_docids.rs/test_update/initial/word_prefix_pair_proximity_docids.snap rename to milli/src/update/snapshots/word_prefix_pair_proximity_docids.rs/test_update/initial/word_prefix_pair_proximity_docids.snap diff --git a/milli/src/update/snapshots/update/word_prefix_pair_proximity_docids.rs/test_update/update/word_prefix_pair_proximity_docids.snap b/milli/src/update/snapshots/word_prefix_pair_proximity_docids.rs/test_update/update/word_prefix_pair_proximity_docids.snap similarity index 100% rename from milli/src/update/snapshots/update/word_prefix_pair_proximity_docids.rs/test_update/update/word_prefix_pair_proximity_docids.snap rename to milli/src/update/snapshots/word_prefix_pair_proximity_docids.rs/test_update/update/word_prefix_pair_proximity_docids.snap