Skip to main content

Module testing

Module testing 

Source
Expand description

A conformance suite for ObjectStore implementations, and the harness every live test of the stack shares (feature testing).

Every backend in this crate passes it, and crates wrapping other storage in the trait (for example an application’s own GCS client) can run it too:

objstore_r::testing::conformance(&objstore_r::Mem::default(), "t").await.unwrap();

Functions§

clean
Delete everything under prefix/ and confirm nothing is left.
conformance
Run the suite under prefix (a valid key; everything is written below it and deleted afterwards). Returns the first violated expectation.
conformance_encoded
The content-encoding contract (ObjectStore::put_encoded) under prefix, for stores that support gzip (every backend here, with feature gzip): encoded and plain objects round-trip, stat/list_stat report the encoding, ranged reads of encoded objects refuse, conditions behave as for put, and plain ⇄ encoded rewrites of one key read correctly.
emulator_bucket
A fresh bucket on the fake-gcs-server named by OBJSTORE_FAKE_GCS, with uploads above resumable_threshold bytes resumable; None (skip) when unset.
live_bucket
The live bucket named by OBJSTORE_LIVE_BUCKET, through Application Default Credentials; None (skip) when unset.
unique
A unique key prefix for one test run: tag-pid-nanos.