mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-06-18 10:28:10 +00:00
tests: Faster search::multi IT tests
Use shared server + unique indices where possible Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
This commit is contained in:
parent
170ad87e44
commit
8fa6e8670a
@ -43,23 +43,20 @@ pub fn default_snapshot_settings_for_test<'a>(
|
||||
}
|
||||
}
|
||||
|
||||
settings.add_dynamic_redaction(".message", uuid_in_message_redaction);
|
||||
settings.add_dynamic_redaction(".error.message", uuid_in_message_redaction);
|
||||
settings.add_dynamic_redaction(".indexUid", |content, _content_path| match &content {
|
||||
fn uuid_in_index_uid_redaction(content: Content, _content_path: ContentPath) -> Content {
|
||||
match &content {
|
||||
Content::String(s) => match uuid::Uuid::parse_str(s) {
|
||||
Ok(_) => Content::String("[uuid]".to_owned()),
|
||||
Err(_) => content,
|
||||
},
|
||||
_ => content,
|
||||
});
|
||||
|
||||
settings.add_dynamic_redaction(".error.message", |content, _content_path| match &content {
|
||||
Content::String(s) => {
|
||||
let uuid_replaced = UUID_IN_MESSAGE_RE.replace_all(s, "$before[uuid]$after");
|
||||
Content::String(uuid_replaced.to_string())
|
||||
}
|
||||
_ => content,
|
||||
});
|
||||
}
|
||||
|
||||
settings.add_dynamic_redaction(".message", uuid_in_message_redaction);
|
||||
settings.add_dynamic_redaction(".error.message", uuid_in_message_redaction);
|
||||
settings.add_dynamic_redaction(".indexUid", uuid_in_index_uid_redaction);
|
||||
settings.add_dynamic_redaction(".**.indexUid", uuid_in_index_uid_redaction);
|
||||
|
||||
let test_name = test_name.strip_suffix("::{{closure}}").unwrap_or(test_name);
|
||||
let test_name = test_name.rsplit("::").next().unwrap().to_owned();
|
||||
|
@ -269,7 +269,7 @@ pub async fn shared_index_with_score_documents() -> &'static Index<'static, Shar
|
||||
static INDEX: OnceCell<Index<'static, Shared>> = OnceCell::const_new();
|
||||
INDEX.get_or_init(|| async {
|
||||
let server = Server::new_shared();
|
||||
let index = server._index("SCORE_DOCUMENTS").to_shared();
|
||||
let index = server._index("SHARED_SCORE_DOCUMENTS").to_shared();
|
||||
let documents = SCORE_DOCUMENTS.clone();
|
||||
let (response, _code) = index._add_documents(documents, None).await;
|
||||
index.wait_task(response.uid()).await.succeeded();
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user