diff --git a/crates/meilisearch/tests/common/mod.rs b/crates/meilisearch/tests/common/mod.rs index 9727d45bd..a0137931d 100644 --- a/crates/meilisearch/tests/common/mod.rs +++ b/crates/meilisearch/tests/common/mod.rs @@ -392,20 +392,22 @@ pub static VECTOR_DOCUMENTS: Lazy = Lazy::new(|| { pub async fn shared_index_with_test_set() -> &'static Index<'static, Shared> { static INDEX: OnceCell> = OnceCell::const_new(); - INDEX.get_or_init(|| async { - let server = Server::new_shared(); - let index = server._index("SHARED_TEST_SET").to_shared(); - let url = format!("/indexes/{}/documents", urlencoding::encode(index.uid.as_ref())); - let (response, code) = index - .service - .post_str( - url, - include_str!("../assets/test_set.json"), - vec![("content-type", "application/json")], - ) - .await; - assert_eq!(code, 202); - index.wait_task(response.uid()).await; - index - }).await -} \ No newline at end of file + INDEX + .get_or_init(|| async { + let server = Server::new_shared(); + let index = server._index("SHARED_TEST_SET").to_shared(); + let url = format!("/indexes/{}/documents", urlencoding::encode(index.uid.as_ref())); + let (response, code) = index + .service + .post_str( + url, + include_str!("../assets/test_set.json"), + vec![("content-type", "application/json")], + ) + .await; + assert_eq!(code, 202); + index.wait_task(response.uid()).await; + index + }) + .await +} diff --git a/crates/meilisearch/tests/documents/get_documents.rs b/crates/meilisearch/tests/documents/get_documents.rs index 8aaeb10be..d66d36c56 100644 --- a/crates/meilisearch/tests/documents/get_documents.rs +++ b/crates/meilisearch/tests/documents/get_documents.rs @@ -4,7 +4,10 @@ use meili_snap::*; use urlencoding::encode as urlencode; use crate::common::encoder::Encoder; -use crate::common::{shared_does_not_exists_index, shared_empty_index, shared_index_with_test_set, GetAllDocumentsOptions, Server, Value}; +use crate::common::{ + shared_does_not_exists_index, shared_empty_index, shared_index_with_test_set, + GetAllDocumentsOptions, Server, Value, +}; use crate::json; // TODO: partial test since we are testing error, amd error is not yet fully implemented in @@ -159,7 +162,7 @@ async fn get_all_documents_no_options_with_response_compression() { #[actix_rt::test] async fn test_get_all_documents_limit() { - let index = shared_index_with_test_set().await; + let index = shared_index_with_test_set().await; let (response, code) = index .get_all_documents(GetAllDocumentsOptions { limit: Some(5), ..Default::default() }) @@ -191,7 +194,6 @@ async fn test_get_all_documents_offset() { async fn test_get_all_documents_attributes_to_retrieve() { let index = shared_index_with_test_set().await; - let (response, code) = index .get_all_documents(GetAllDocumentsOptions { fields: Some(vec!["name"]),