pub struct TestECStoreEnv {
pub temp_root: PathBuf,
pub disk_paths: Vec<PathBuf>,
pub ecstore: Arc<ECStore>,
pub endpoint_pools: EndpointServerPools,
}Expand description
A real single-pool, single-set ECStore built over per-test temp-dir
“disks”. Build one with TestECStoreEnv::builder.
The environment intentionally does not delete temp_root on drop:
the historical bootstraps leaked their uuid-suffixed temp dirs so a failed
test’s on-disk state stays inspectable, and several heal tests keep
manipulating disk_paths after setup. Callers that own the directory
lifetime (e.g. via tempfile::TempDir) should pass it through
TestECStoreEnvBuilder::base_dir.
Fields§
§temp_root: PathBufRoot directory holding the disk directories.
disk_paths: Vec<PathBuf>The per-disk directories (disk1..diskN) under temp_root.
ecstore: Arc<ECStore>The store, bootstrapped exactly like the historical test setups:
init_local_disks + ECStore::new on 127.0.0.1:0 (random port keeps
nextest’s process-per-test parallelism safe).
endpoint_pools: EndpointServerPoolsThe single-pool, single-set topology the store was built from.
The bootstrap does not publish it on the instance context (server
startup is what calls set_endpoints, and that write is once-only), so
a test that needs get_global_endpoints to resolve — admin server-info
and other topology readers — publishes this value itself.
Implementations§
Source§impl TestECStoreEnv
impl TestECStoreEnv
pub fn builder() -> TestECStoreEnvBuilder
Sourcepub async fn make_bucket(&self, bucket: &str, versioned: bool)
pub async fn make_bucket(&self, bucket: &str, versioned: bool)
Create a bucket, optionally with S3 versioning enabled at creation time (without this a second PUT overwrites in place and DELETE removes the object outright — no old versions or delete-marker-latest exist).
Sourcepub async fn put_object_bytes(&self, bucket: &str, object: &str, bytes: Vec<u8>)
pub async fn put_object_bytes(&self, bucket: &str, object: &str, bytes: Vec<u8>)
Write one complete object body through the real ECStore test backend.
Sourcepub async fn prepare_select_object_snapshot(
&self,
bucket: &str,
object: &str,
) -> Arc<SelectObjectSnapshot> ⓘ
pub async fn prepare_select_object_snapshot( &self, bucket: &str, object: &str, ) -> Arc<SelectObjectSnapshot> ⓘ
Prepare the lock-backed object snapshot used by SelectObjectContent tests.
The concrete ECStore snapshot type stays behind this crate’s test compatibility boundary; consumers can pass the inferred value directly to the S3 Select API without importing ECStore facade paths.
Auto Trait Implementations§
impl !RefUnwindSafe for TestECStoreEnv
impl !UnwindSafe for TestECStoreEnv
impl Freeze for TestECStoreEnv
impl Send for TestECStoreEnv
impl Sync for TestECStoreEnv
impl Unpin for TestECStoreEnv
impl UnsafeUnpin for TestECStoreEnv
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request