From 7093bae13111b51aee6e2af2f929125aad67b7ec Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Wed, 23 Nov 2022 14:48:39 +0100 Subject: [PATCH] Update the dump test to check for the dumpUid dumpCreation task details --- index-scheduler/src/utils.rs | 6 ++---- meilisearch-http/tests/tasks/mod.rs | 5 ++++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/index-scheduler/src/utils.rs b/index-scheduler/src/utils.rs index effa4e7f8..a193c2bec 100644 --- a/index-scheduler/src/utils.rs +++ b/index-scheduler/src/utils.rs @@ -487,10 +487,8 @@ impl IndexScheduler { assert_ne!(status, Status::Succeeded); } } - Details::Dump { dump_uid: d1 } => { - assert!( - matches!(&kind, KindWithContent::DumpCreation { dump_uid: d2, keys: _, instance_uid: _ } if &d1 == d2 ) - ); + Details::Dump { dump_uid: _ } => { + assert_eq!(kind.as_kind(), Kind::DumpCreation); } } } diff --git a/meilisearch-http/tests/tasks/mod.rs b/meilisearch-http/tests/tasks/mod.rs index c7cda2cb6..548fa90be 100644 --- a/meilisearch-http/tests/tasks/mod.rs +++ b/meilisearch-http/tests/tasks/mod.rs @@ -983,7 +983,7 @@ async fn test_summarized_dump_creation() { server.wait_task(0).await; let (task, _) = server.get_task(0).await; assert_json_snapshot!(task, - { ".duration" => "[duration]", ".enqueuedAt" => "[date]", ".startedAt" => "[date]", ".finishedAt" => "[date]" }, + { ".details.dumpUid" => "[dumpUid]", ".duration" => "[duration]", ".enqueuedAt" => "[date]", ".startedAt" => "[date]", ".finishedAt" => "[date]" }, @r###" { "uid": 0, @@ -991,6 +991,9 @@ async fn test_summarized_dump_creation() { "status": "succeeded", "type": "dumpCreation", "canceledBy": null, + "details": { + "dumpUid": "[dumpUid]" + }, "error": null, "duration": "[duration]", "enqueuedAt": "[date]",