From 7074872a780a77b31d2b9adf398345e6c16380e0 Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Wed, 26 Oct 2022 10:55:21 +0200 Subject: [PATCH] cargo insta accept --- dump/src/reader/compat/v2_to_v3.rs | 2 +- dump/src/reader/compat/v3_to_v4.rs | 2 +- dump/src/reader/compat/v4_to_v5.rs | 2 +- dump/src/reader/compat/v5_to_v6.rs | 2 +- dump/src/reader/mod.rs | 8 ++--- dump/src/reader/v2/mod.rs | 2 +- dump/src/reader/v3/mod.rs | 2 +- dump/src/reader/v4/mod.rs | 2 +- dump/src/reader/v5/mod.rs | 2 +- ...x_scheduler__tests__document_addition.snap | 24 ++++++++++++++ .../index_scheduler__tests__register.snap | 31 +++++++++++++++++++ ...uler__tests__task_deletion_deleteable.snap | 26 ++++++++++++++++ ...er__tests__task_deletion_undeleteable.snap | 28 +++++++++++++++++ .../initial_tasks_processed.snap | 16 ++-------- .../initial_tasks_processed.snap | 16 ++-------- 15 files changed, 127 insertions(+), 38 deletions(-) create mode 100644 index-scheduler/src/snapshots/index_scheduler__tests__document_addition.snap create mode 100644 index-scheduler/src/snapshots/index_scheduler__tests__register.snap create mode 100644 index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_deleteable.snap create mode 100644 index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_undeleteable.snap diff --git a/dump/src/reader/compat/v2_to_v3.rs b/dump/src/reader/compat/v2_to_v3.rs index ae1f7118c..b522c813a 100644 --- a/dump/src/reader/compat/v2_to_v3.rs +++ b/dump/src/reader/compat/v2_to_v3.rs @@ -425,7 +425,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"54b3d7a0d96de35427d867fa17164a99"); + meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"f43338ecceeddd1ce13ffd55438b2347"); let documents = products.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"548284a84de510f71e88e6cdea495cf5"); diff --git a/dump/src/reader/compat/v3_to_v4.rs b/dump/src/reader/compat/v3_to_v4.rs index 20af18c21..99f2ae952 100644 --- a/dump/src/reader/compat/v3_to_v4.rs +++ b/dump/src/reader/compat/v3_to_v4.rs @@ -395,7 +395,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"d3402aff19b90acea9e9a07c466690aa"); + meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"ea46dd6b58c5e1d65c1c8159a32695ea"); let documents = products.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"548284a84de510f71e88e6cdea495cf5"); diff --git a/dump/src/reader/compat/v4_to_v5.rs b/dump/src/reader/compat/v4_to_v5.rs index a7d695cbe..3bdfc7e30 100644 --- a/dump/src/reader/compat/v4_to_v5.rs +++ b/dump/src/reader/compat/v4_to_v5.rs @@ -428,7 +428,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"26947283836ee4cdf0974f82efcc5332"); + meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"ed1a6977a832b1ab49cd5068b77ce498"); let documents = products.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"b01c8371aea4c7171af0d4d846a2bdca"); diff --git a/dump/src/reader/compat/v5_to_v6.rs b/dump/src/reader/compat/v5_to_v6.rs index 5d01f0c47..6c586ffb1 100644 --- a/dump/src/reader/compat/v5_to_v6.rs +++ b/dump/src/reader/compat/v5_to_v6.rs @@ -447,7 +447,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"8e5cadabf74aebe1160bf51c3d489efe"); + meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"9896a66a399c24a0f4f6a3c8563cd14a"); let documents = products.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"b01c8371aea4c7171af0d4d846a2bdca"); diff --git a/dump/src/reader/mod.rs b/dump/src/reader/mod.rs index dbbcab88b..b04fb6e0c 100644 --- a/dump/src/reader/mod.rs +++ b/dump/src/reader/mod.rs @@ -228,7 +228,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"8e5cadabf74aebe1160bf51c3d489efe"); + meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"9896a66a399c24a0f4f6a3c8563cd14a"); let documents = products.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"b01c8371aea4c7171af0d4d846a2bdca"); @@ -305,7 +305,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"1f9da51a4518166fb440def5437eafdb"); + meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"ed1a6977a832b1ab49cd5068b77ce498"); let documents = products.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"b01c8371aea4c7171af0d4d846a2bdca"); @@ -383,7 +383,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"855f3165dec609b919171ff83f82b364"); + meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"1a5ed16d00e6163662d9d7ffe400c5d0"); let documents = products.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"548284a84de510f71e88e6cdea495cf5"); @@ -476,7 +476,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"b15b71f56dd082d8e8ec5182e688bf36"); + meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"a7d4fed93bfc91d0f1126d3371abf48e"); let documents = products.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"548284a84de510f71e88e6cdea495cf5"); diff --git a/dump/src/reader/v2/mod.rs b/dump/src/reader/v2/mod.rs index 73396db50..97dac0e60 100644 --- a/dump/src/reader/v2/mod.rs +++ b/dump/src/reader/v2/mod.rs @@ -255,7 +255,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"c41bf7315d404da46c99b9e3a2a3cc1e"); + meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"b4814eab5e73e2dcfc90aad50aa583d1"); let documents = products.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"548284a84de510f71e88e6cdea495cf5"); diff --git a/dump/src/reader/v3/mod.rs b/dump/src/reader/v3/mod.rs index 387064f97..888ad73d5 100644 --- a/dump/src/reader/v3/mod.rs +++ b/dump/src/reader/v3/mod.rs @@ -271,7 +271,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"f309b009608cc0b770b2f74516f92647"); + meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"7460d4b242b5c8b1bda223f63bbbf349"); let documents = products.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"548284a84de510f71e88e6cdea495cf5"); diff --git a/dump/src/reader/v4/mod.rs b/dump/src/reader/v4/mod.rs index d71cd5d6a..29076f448 100644 --- a/dump/src/reader/v4/mod.rs +++ b/dump/src/reader/v4/mod.rs @@ -267,7 +267,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"65b139c6b9fc251e187073c8557803e2"); + meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"ace6546a6eb856ecb770b2409975c01d"); let documents = products.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"b01c8371aea4c7171af0d4d846a2bdca"); diff --git a/dump/src/reader/v5/mod.rs b/dump/src/reader/v5/mod.rs index 5df544bd0..d7e6eb330 100644 --- a/dump/src/reader/v5/mod.rs +++ b/dump/src/reader/v5/mod.rs @@ -310,7 +310,7 @@ pub(crate) mod test { } "###); - meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"b392b928dab63468318b2bdaad844c5a"); + meili_snap::snapshot_hash!(format!("{:#?}", products.settings()), @"9896a66a399c24a0f4f6a3c8563cd14a"); let documents = products.documents().unwrap().collect::>>().unwrap(); assert_eq!(documents.len(), 10); meili_snap::snapshot_hash!(format!("{:#?}", documents), @"b01c8371aea4c7171af0d4d846a2bdca"); diff --git a/index-scheduler/src/snapshots/index_scheduler__tests__document_addition.snap b/index-scheduler/src/snapshots/index_scheduler__tests__document_addition.snap new file mode 100644 index 000000000..16c8fcd11 --- /dev/null +++ b/index-scheduler/src/snapshots/index_scheduler__tests__document_addition.snap @@ -0,0 +1,24 @@ +--- +source: index-scheduler/src/lib.rs +expression: snapshot_index_scheduler(&index_scheduler) +--- +### Autobatching Enabled = true +### Processing Tasks: +[] +---------------------------------------------------------------------- +### All Tasks: +0 {uid: 0, status: enqueued, details: { received_documents: 1, indexed_documents: 0 }, kind: DocumentImport { index_uid: "doggos", primary_key: Some("id"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000000, documents_count: 1, allow_index_creation: true }} +---------------------------------------------------------------------- +### Status: +enqueued [0,] +---------------------------------------------------------------------- +### Kind: +"documentImport" [0,] +---------------------------------------------------------------------- +### Index Tasks: +doggos [0,] +---------------------------------------------------------------------- +### Index Mapper: +[] +---------------------------------------------------------------------- + diff --git a/index-scheduler/src/snapshots/index_scheduler__tests__register.snap b/index-scheduler/src/snapshots/index_scheduler__tests__register.snap new file mode 100644 index 000000000..66abf0e71 --- /dev/null +++ b/index-scheduler/src/snapshots/index_scheduler__tests__register.snap @@ -0,0 +1,31 @@ +--- +source: index-scheduler/src/lib.rs +expression: snapshot_index_scheduler(&index_scheduler) +--- +### Autobatching Enabled = true +### Processing Tasks: +[] +---------------------------------------------------------------------- +### All Tasks: +0 {uid: 0, status: enqueued, details: { primary_key: Some("mouse") }, kind: IndexCreation { index_uid: "catto", primary_key: Some("mouse") }} +1 {uid: 1, status: enqueued, details: { received_documents: 12, indexed_documents: 0 }, kind: DocumentImport { index_uid: "catto", primary_key: None, method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000000, documents_count: 12, allow_index_creation: true }} +2 {uid: 2, status: enqueued, kind: CancelTask { tasks: [0, 1] }} +3 {uid: 3, status: enqueued, details: { received_documents: 50, indexed_documents: 0 }, kind: DocumentImport { index_uid: "catto", primary_key: None, method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000001, documents_count: 50, allow_index_creation: true }} +4 {uid: 4, status: enqueued, details: { received_documents: 5000, indexed_documents: 0 }, kind: DocumentImport { index_uid: "doggo", primary_key: Some("bone"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000002, documents_count: 5000, allow_index_creation: true }} +---------------------------------------------------------------------- +### Status: +enqueued [0,1,2,3,4,] +---------------------------------------------------------------------- +### Kind: +"documentImport" [1,3,4,] +"indexCreation" [0,] +"cancelTask" [2,] +---------------------------------------------------------------------- +### Index Tasks: +catto [0,1,3,] +doggo [4,] +---------------------------------------------------------------------- +### Index Mapper: +[] +---------------------------------------------------------------------- + diff --git a/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_deleteable.snap b/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_deleteable.snap new file mode 100644 index 000000000..fe16eceed --- /dev/null +++ b/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_deleteable.snap @@ -0,0 +1,26 @@ +--- +source: index-scheduler/src/lib.rs +expression: snapshot_index_scheduler(&index_scheduler) +--- +### Autobatching Enabled = true +### Processing Tasks: +[] +---------------------------------------------------------------------- +### All Tasks: +0 {uid: 0, status: enqueued, details: { received_documents: 1, indexed_documents: 0 }, kind: DocumentImport { index_uid: "catto", primary_key: None, method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000000, documents_count: 1, allow_index_creation: true }} +1 {uid: 1, status: enqueued, details: { received_documents: 1, indexed_documents: 0 }, kind: DocumentImport { index_uid: "doggo", primary_key: Some("bone"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000001, documents_count: 1, allow_index_creation: true }} +---------------------------------------------------------------------- +### Status: +enqueued [0,1,] +---------------------------------------------------------------------- +### Kind: +"documentImport" [0,1,] +---------------------------------------------------------------------- +### Index Tasks: +catto [0,] +doggo [1,] +---------------------------------------------------------------------- +### Index Mapper: +[] +---------------------------------------------------------------------- + diff --git a/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_undeleteable.snap b/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_undeleteable.snap new file mode 100644 index 000000000..09a4d9a84 --- /dev/null +++ b/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_undeleteable.snap @@ -0,0 +1,28 @@ +--- +source: index-scheduler/src/lib.rs +expression: snapshot_index_scheduler(&index_scheduler) +--- +### Autobatching Enabled = true +### Processing Tasks: +[] +---------------------------------------------------------------------- +### All Tasks: +0 {uid: 0, status: enqueued, details: { primary_key: Some("mouse") }, kind: IndexCreation { index_uid: "catto", primary_key: Some("mouse") }} +1 {uid: 1, status: enqueued, details: { received_documents: 12, indexed_documents: 0 }, kind: DocumentImport { index_uid: "catto", primary_key: None, method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000000, documents_count: 12, allow_index_creation: true }} +2 {uid: 2, status: enqueued, details: { received_documents: 5000, indexed_documents: 0 }, kind: DocumentImport { index_uid: "doggo", primary_key: Some("bone"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000001, documents_count: 5000, allow_index_creation: true }} +---------------------------------------------------------------------- +### Status: +enqueued [0,1,2,] +---------------------------------------------------------------------- +### Kind: +"documentImport" [1,2,] +"indexCreation" [0,] +---------------------------------------------------------------------- +### Index Tasks: +catto [0,1,] +doggo [2,] +---------------------------------------------------------------------- +### Index Mapper: +[] +---------------------------------------------------------------------- + diff --git a/index-scheduler/src/snapshots/lib.rs/task_deletion_delete_same_task_twice/initial_tasks_processed.snap b/index-scheduler/src/snapshots/lib.rs/task_deletion_delete_same_task_twice/initial_tasks_processed.snap index c33926a04..1292690ab 100644 --- a/index-scheduler/src/snapshots/lib.rs/task_deletion_delete_same_task_twice/initial_tasks_processed.snap +++ b/index-scheduler/src/snapshots/lib.rs/task_deletion_delete_same_task_twice/initial_tasks_processed.snap @@ -6,15 +6,15 @@ source: index-scheduler/src/lib.rs [] ---------------------------------------------------------------------- ### All Tasks: -0 {uid: 0, status: succeeded, details: { received_documents: 1, indexed_documents: Some(1) }, kind: DocumentAdditionOrUpdate { index_uid: "catto", primary_key: None, method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000000, documents_count: 1, allow_index_creation: true }} -1 {uid: 1, status: enqueued, details: { received_documents: 1, indexed_documents: None }, kind: DocumentAdditionOrUpdate { index_uid: "doggo", primary_key: Some("bone"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000001, documents_count: 1, allow_index_creation: true }} +0 {uid: 0, status: succeeded, details: { received_documents: 1, indexed_documents: Some(1) }, kind: DocumentImport { index_uid: "catto", primary_key: None, method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000000, documents_count: 1, allow_index_creation: true }} +1 {uid: 1, status: enqueued, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentImport { index_uid: "doggo", primary_key: Some("bone"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000001, documents_count: 1, allow_index_creation: true }} ---------------------------------------------------------------------- ### Status: enqueued [1,] succeeded [0,] ---------------------------------------------------------------------- ### Kind: -"documentAdditionOrUpdate" [0,1,] +"documentImport" [0,1,] ---------------------------------------------------------------------- ### Index Tasks: catto [0,] @@ -23,16 +23,6 @@ doggo [1,] ### Index Mapper: ["catto"] ---------------------------------------------------------------------- -### Enqueued At: -[timestamp] [0,] -[timestamp] [1,] ----------------------------------------------------------------------- -### Started At: -[timestamp] [0,] ----------------------------------------------------------------------- -### Finished At: -[timestamp] [0,] ----------------------------------------------------------------------- ### File Store: 00000000-0000-0000-0000-000000000001 diff --git a/index-scheduler/src/snapshots/lib.rs/task_deletion_deleteable/initial_tasks_processed.snap b/index-scheduler/src/snapshots/lib.rs/task_deletion_deleteable/initial_tasks_processed.snap index c33926a04..1292690ab 100644 --- a/index-scheduler/src/snapshots/lib.rs/task_deletion_deleteable/initial_tasks_processed.snap +++ b/index-scheduler/src/snapshots/lib.rs/task_deletion_deleteable/initial_tasks_processed.snap @@ -6,15 +6,15 @@ source: index-scheduler/src/lib.rs [] ---------------------------------------------------------------------- ### All Tasks: -0 {uid: 0, status: succeeded, details: { received_documents: 1, indexed_documents: Some(1) }, kind: DocumentAdditionOrUpdate { index_uid: "catto", primary_key: None, method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000000, documents_count: 1, allow_index_creation: true }} -1 {uid: 1, status: enqueued, details: { received_documents: 1, indexed_documents: None }, kind: DocumentAdditionOrUpdate { index_uid: "doggo", primary_key: Some("bone"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000001, documents_count: 1, allow_index_creation: true }} +0 {uid: 0, status: succeeded, details: { received_documents: 1, indexed_documents: Some(1) }, kind: DocumentImport { index_uid: "catto", primary_key: None, method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000000, documents_count: 1, allow_index_creation: true }} +1 {uid: 1, status: enqueued, details: { received_documents: 1, indexed_documents: Some(0) }, kind: DocumentImport { index_uid: "doggo", primary_key: Some("bone"), method: ReplaceDocuments, content_file: 00000000-0000-0000-0000-000000000001, documents_count: 1, allow_index_creation: true }} ---------------------------------------------------------------------- ### Status: enqueued [1,] succeeded [0,] ---------------------------------------------------------------------- ### Kind: -"documentAdditionOrUpdate" [0,1,] +"documentImport" [0,1,] ---------------------------------------------------------------------- ### Index Tasks: catto [0,] @@ -23,16 +23,6 @@ doggo [1,] ### Index Mapper: ["catto"] ---------------------------------------------------------------------- -### Enqueued At: -[timestamp] [0,] -[timestamp] [1,] ----------------------------------------------------------------------- -### Started At: -[timestamp] [0,] ----------------------------------------------------------------------- -### Finished At: -[timestamp] [0,] ----------------------------------------------------------------------- ### File Store: 00000000-0000-0000-0000-000000000001