Use shared server and unique indices for add_documents IT tests

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
This commit is contained in:
Martin Tzvetanov Grigorov 2025-05-26 11:28:23 +03:00
parent cf5d26124a
commit fc88b003b4
No known key found for this signature in database
GPG key ID: 3194FD8C1AE300EF
5 changed files with 243 additions and 213 deletions

View file

@ -33,6 +33,7 @@ pub fn default_snapshot_settings_for_test<'a>(
let filename = path.file_name().unwrap().to_str().unwrap();
settings.set_omit_expression(true);
<<<<<<< HEAD
fn uuid_in_message_redaction(content: Content, _content_path: ContentPath) -> Content {
match &content {
Content::String(s) => {
@ -45,6 +46,15 @@ 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 {
Content::String(s) => match uuid::Uuid::parse_str(s) {
Ok(_) => Content::String("[uuid]".to_owned()),
Err(_) => content,
},
_ => content,
}
});
let test_name = test_name.strip_suffix("::{{closure}}").unwrap_or(test_name);
let test_name = test_name.rsplit("::").next().unwrap().to_owned();