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

@ -126,7 +126,7 @@ pub enum Error {
#[error(transparent)]
Heed(#[from] heed::Error),
#[error("{}", match .index_uid {
Some(uid) if !uid.is_empty() => format!("Index `{}`: {error}", uid),
Some(uid) if !uid.is_empty() => format!("Index `{}`: {error}", Error::index_name(uid)),
_ => format!("{error}")
})]
Milli { error: milli::Error, index_uid: Option<String> },
@ -177,6 +177,18 @@ pub enum Error {
PlannedFailure,
}
impl Error {
#[inline]
fn index_name(index_name: &str) -> &str {
if let Ok(_) = uuid::Uuid::parse_str(index_name) {
"[uuid]"
} else {
index_name
}
}
}
#[derive(Debug, thiserror::Error)]
#[error(
"{disabled_action} requires enabling the `{feature}` experimental feature. See {issue_link}"