From 434fad5327c0d157e841a48f52a79f43738b1c1d Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Thu, 20 Feb 2025 16:02:23 +0100 Subject: [PATCH] Fix insta tests again --- .../tests/upgrade/v1_12/v1_12_0.rs | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/crates/meilisearch/tests/upgrade/v1_12/v1_12_0.rs b/crates/meilisearch/tests/upgrade/v1_12/v1_12_0.rs index f3bff7467..3a93ba81e 100644 --- a/crates/meilisearch/tests/upgrade/v1_12/v1_12_0.rs +++ b/crates/meilisearch/tests/upgrade/v1_12/v1_12_0.rs @@ -2,6 +2,7 @@ // It must test pretty much all the features of meilisearch because the other tests will only tests // the new features they introduced. +use insta::assert_json_snapshot; use manifest_dir_macros::exist_relative_path; use meili_snap::{json_string, snapshot}; use meilisearch::Opt; @@ -126,10 +127,14 @@ async fn check_the_index_scheduler(server: &Server) { "#); // And their metadata are still right let (stats, _) = server.stats().await; - snapshot!(stats, @r###" + assert_json_snapshot!(stats, { + ".databaseSize" => "[bytes]", + ".usedDatabaseSize" => "[bytes]" + }, + @r###" { - "databaseSize": 438272, - "usedDatabaseSize": 200704, + "databaseSize": [bytes], + "usedDatabaseSize": [bytes], "lastUpdate": "2025-01-23T11:36:22.634859166Z", "indexes": { "kefir": { @@ -208,10 +213,14 @@ async fn check_the_index_scheduler(server: &Server) { snapshot!(json_string!(batches, { ".results[0].duration" => "[duration]", ".results[0].enqueuedAt" => "[date]", ".results[0].startedAt" => "[date]", ".results[0].finishedAt" => "[date]", ".results[0].stats.callTrace" => "[callTrace]", ".results[0].stats.writeChannelCongestion" => "[writeChannelCongestion]" }), name: "batches_filter_afterFinishedAt_equal_2025-01-16T16_47_41"); let (stats, _) = server.stats().await; - snapshot!(stats, @r###" + snapshot!(stats, { + ".databaseSize" => "[bytes]", + ".usedDatabaseSize" => "[bytes]" + }, + @r###" { - "databaseSize": 438272, - "usedDatabaseSize": 200704, + "databaseSize": [bytes], + "usedDatabaseSize": [bytes], "lastUpdate": "2025-01-23T11:36:22.634859166Z", "indexes": { "kefir": {