diff --git a/dump/src/reader/compat/v1_to_v2.rs b/dump/src/reader/compat/v1_to_v2.rs index 23e4529dc..741d18fa8 100644 --- a/dump/src/reader/compat/v1_to_v2.rs +++ b/dump/src/reader/compat/v1_to_v2.rs @@ -1,8 +1,8 @@ -use std::{collections::BTreeSet, str::FromStr}; - -use crate::reader::{v1, v2, Document}; +use std::collections::BTreeSet; +use std::str::FromStr; use super::v2_to_v3::CompatV2ToV3; +use crate::reader::{v1, v2, Document}; use crate::Result; pub struct CompatV1ToV2 { @@ -367,12 +367,12 @@ pub(crate) mod test { assert!(indexes.is_empty()); // products - insta::assert_json_snapshot!(products.metadata(), { ".createdAt" => "[now]", ".updatedAt" => "[now]" }, @r###" + insta::assert_json_snapshot!(products.metadata(), @r###" { "uid": "products", "primaryKey": "sku", - "createdAt": "[now]", - "updatedAt": "[now]" + "createdAt": "2022-10-02T13:23:39.976870431Z", + "updatedAt": "2022-10-02T13:27:54.353262482Z" } "###); @@ -382,12 +382,12 @@ pub(crate) mod test { meili_snap::snapshot_hash!(format!("{:#?}", documents), @"b01c8371aea4c7171af0d4d846a2bdca"); // movies - insta::assert_json_snapshot!(movies.metadata(), { ".createdAt" => "[now]", ".updatedAt" => "[now]" }, @r###" + insta::assert_json_snapshot!(movies.metadata(), @r###" { "uid": "movies", "primaryKey": "id", - "createdAt": "[now]", - "updatedAt": "[now]" + "createdAt": "2022-10-02T13:15:29.477512777Z", + "updatedAt": "2022-10-02T13:21:12.671204856Z" } "###); @@ -397,12 +397,12 @@ pub(crate) mod test { meili_snap::snapshot_hash!(format!("{:#?}", documents), @"b63dbed5bbc059f3e32bc471ae699bf5"); // spells - insta::assert_json_snapshot!(spells.metadata(), { ".createdAt" => "[now]", ".updatedAt" => "[now]" }, @r###" + insta::assert_json_snapshot!(spells.metadata(), @r###" { "uid": "dnd_spells", "primaryKey": "index", - "createdAt": "[now]", - "updatedAt": "[now]" + "createdAt": "2022-10-02T13:38:26.358882984Z", + "updatedAt": "2022-10-02T13:38:26.385609433Z" } "###); diff --git a/dump/src/reader/mod.rs b/dump/src/reader/mod.rs index efbca06d0..5e493d77e 100644 --- a/dump/src/reader/mod.rs +++ b/dump/src/reader/mod.rs @@ -562,12 +562,12 @@ pub(crate) mod test { assert!(indexes.is_empty()); // products - insta::assert_json_snapshot!(products.metadata(), { ".createdAt" => "[now]", ".updatedAt" => "[now]" }, @r###" + insta::assert_json_snapshot!(products.metadata(), @r###" { "uid": "products", "primaryKey": "sku", - "createdAt": "[now]", - "updatedAt": "[now]" + "createdAt": "2022-10-02T13:23:39.976870431Z", + "updatedAt": "2022-10-02T13:27:54.353262482Z" } "###); @@ -577,12 +577,12 @@ pub(crate) mod test { meili_snap::snapshot_hash!(format!("{:#?}", documents), @"b01c8371aea4c7171af0d4d846a2bdca"); // movies - insta::assert_json_snapshot!(movies.metadata(), { ".createdAt" => "[now]", ".updatedAt" => "[now]" }, @r###" + insta::assert_json_snapshot!(movies.metadata(), @r###" { "uid": "movies", "primaryKey": "id", - "createdAt": "[now]", - "updatedAt": "[now]" + "createdAt": "2022-10-02T13:15:29.477512777Z", + "updatedAt": "2022-10-02T13:21:12.671204856Z" } "###); @@ -592,12 +592,12 @@ pub(crate) mod test { meili_snap::snapshot_hash!(format!("{:#?}", documents), @"b63dbed5bbc059f3e32bc471ae699bf5"); // spells - insta::assert_json_snapshot!(spells.metadata(), { ".createdAt" => "[now]", ".updatedAt" => "[now]" }, @r###" + insta::assert_json_snapshot!(spells.metadata(), @r###" { "uid": "dnd_spells", "primaryKey": "index", - "createdAt": "[now]", - "updatedAt": "[now]" + "createdAt": "2022-10-02T13:38:26.358882984Z", + "updatedAt": "2022-10-02T13:38:26.385609433Z" } "###); diff --git a/dump/src/reader/v1/mod.rs b/dump/src/reader/v1/mod.rs index 1932b602a..ac7324d9a 100644 --- a/dump/src/reader/v1/mod.rs +++ b/dump/src/reader/v1/mod.rs @@ -1,15 +1,14 @@ -use std::{ - fs::{self, File}, - io::{BufRead, BufReader}, - path::{Path, PathBuf}, -}; +use std::fs::{self, File}; +use std::io::{BufRead, BufReader}; +use std::path::{Path, PathBuf}; +use serde::Deserialize; use tempfile::TempDir; use time::OffsetDateTime; -use super::{compat::v1_to_v2::CompatV1ToV2, Document}; +use super::compat::v1_to_v2::CompatV1ToV2; +use super::Document; use crate::{IndexMetadata, Result, Version}; -use serde::Deserialize; pub mod settings; pub mod update; @@ -204,12 +203,12 @@ pub(crate) mod test { assert!(indexes.is_empty()); // products - insta::assert_json_snapshot!(products.metadata(), { ".createdAt" => "[now]", ".updatedAt" => "[now]" }, @r###" + insta::assert_json_snapshot!(products.metadata(), @r###" { "uid": "products", "primaryKey": "sku", - "createdAt": "[now]", - "updatedAt": "[now]" + "createdAt": "2022-10-02T13:23:39.976870431Z", + "updatedAt": "2022-10-02T13:27:54.353262482Z" } "###); @@ -223,12 +222,12 @@ pub(crate) mod test { meili_snap::snapshot_hash!(meili_snap::json_string!(tasks), @"91de507f206ad21964584021932ba7a7"); // movies - insta::assert_json_snapshot!(movies.metadata(), { ".createdAt" => "[now]", ".updatedAt" => "[now]" }, @r###" + insta::assert_json_snapshot!(movies.metadata(), @r###" { "uid": "movies", "primaryKey": "id", - "createdAt": "[now]", - "updatedAt": "[now]" + "createdAt": "2022-10-02T13:15:29.477512777Z", + "updatedAt": "2022-10-02T13:21:12.671204856Z" } "###); @@ -242,12 +241,12 @@ pub(crate) mod test { meili_snap::snapshot_hash!(meili_snap::json_string!(tasks), @"55eef4de2bef7e84c5ce0bee47488f56"); // spells - insta::assert_json_snapshot!(dnd_spells.metadata(), { ".createdAt" => "[now]", ".updatedAt" => "[now]" }, @r###" + insta::assert_json_snapshot!(dnd_spells.metadata(), @r###" { "uid": "dnd_spells", "primaryKey": "index", - "createdAt": "[now]", - "updatedAt": "[now]" + "createdAt": "2022-10-02T13:38:26.358882984Z", + "updatedAt": "2022-10-02T13:38:26.385609433Z" } "###);