mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 04:17:10 +02:00
Use a Regex in insta dynamic redaction to replace Uuids with [uuid]
Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
This commit is contained in:
parent
ce9c930d10
commit
f3d691667d
2 changed files with 9 additions and 12 deletions
|
@ -55,6 +55,14 @@ pub fn default_snapshot_settings_for_test<'a>(
|
|||
}
|
||||
});
|
||||
|
||||
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,
|
||||
});
|
||||
|
||||
let test_name = test_name.strip_suffix("::{{closure}}").unwrap_or(test_name);
|
||||
let test_name = test_name.rsplit("::").next().unwrap().to_owned();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue