mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-06-18 18:38:27 +00:00
More fixes of the tests
Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
This commit is contained in:
parent
1824fbd1b5
commit
6a683975bf
@ -43,10 +43,30 @@ pub fn default_snapshot_settings_for_test<'a>(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn uuid_in_json_key_redaction(content: Content, _content_path: ContentPath) -> Content {
|
||||||
|
match content {
|
||||||
|
Content::Map(map) => {
|
||||||
|
let new_map = map.iter()
|
||||||
|
.map(|(key, value)| {
|
||||||
|
match key {
|
||||||
|
Content::String(s) => {
|
||||||
|
let uuid_replaced = UUID_IN_MESSAGE_RE.replace_all(s, "[uuid]");
|
||||||
|
(Content::String(uuid_replaced.to_string()), value.clone())
|
||||||
|
}
|
||||||
|
_ => (key.clone(), value.clone()),
|
||||||
|
}
|
||||||
|
}).collect();
|
||||||
|
Content::Map(new_map)
|
||||||
|
}
|
||||||
|
_ => content,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
settings.add_dynamic_redaction(".message", uuid_in_message_redaction);
|
settings.add_dynamic_redaction(".message", uuid_in_message_redaction);
|
||||||
settings.add_dynamic_redaction(".**.message", uuid_in_message_redaction);
|
settings.add_dynamic_redaction(".**.message", uuid_in_message_redaction);
|
||||||
settings.add_dynamic_redaction(".indexUid", uuid_in_message_redaction);
|
settings.add_dynamic_redaction(".indexUid", uuid_in_message_redaction);
|
||||||
settings.add_dynamic_redaction(".**.indexUid", uuid_in_message_redaction);
|
settings.add_dynamic_redaction(".**.indexUid", uuid_in_message_redaction);
|
||||||
|
settings.add_dynamic_redaction(".facetsByIndex", uuid_in_json_key_redaction);
|
||||||
|
|
||||||
let test_name = test_name.strip_suffix("::{{closure}}").unwrap_or(test_name);
|
let test_name = test_name.strip_suffix("::{{closure}}").unwrap_or(test_name);
|
||||||
let test_name = test_name.rsplit("::").next().unwrap().to_owned();
|
let test_name = test_name.rsplit("::").next().unwrap().to_owned();
|
||||||
|
@ -350,7 +350,7 @@ impl<State> Server<State> {
|
|||||||
pub fn unique_index_with_prefix(&self, prefix: &str) -> Index<'_> {
|
pub fn unique_index_with_prefix(&self, prefix: &str) -> Index<'_> {
|
||||||
let uuid = Uuid::new_v4();
|
let uuid = Uuid::new_v4();
|
||||||
Index {
|
Index {
|
||||||
uid: format!("{prefix}-{}", uuid.to_string()),
|
uid: format!("{prefix}-{}", uuid),
|
||||||
service: &self.service,
|
service: &self.service,
|
||||||
encoder: Encoder::Plain,
|
encoder: Encoder::Plain,
|
||||||
marker: PhantomData,
|
marker: PhantomData,
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user