Macro event_cache_store_media_integration_tests

Source
macro_rules! event_cache_store_media_integration_tests {
    (with_media_size_tests) => { ... };
    () => { ... };
    (@inner) => { ... };
}
Available on crate feature testing only.
Expand description

Macro building to allow your EventCacheStoreMedia implementation to run the entire tests suite locally.

Can be run with the with_media_size_tests argument to include more tests about the media cache retention policy based on content size. It is not recommended to run those in encrypted stores because the size of the encrypted content may vary compared to what the tests expect.

You need to provide an async fn get_event_cache_store() -> event_cache::store::Result<Store> that provides a fresh event cache store that implements EventCacheStoreMedia on the same level you invoke the macro.

ยงUsage Example:


#[cfg(test)]
mod tests {
    use super::{EventCacheStoreResult, MyStore};

    async fn get_event_cache_store() -> EventCacheStoreResult<MyStore> {
        Ok(MyStore::new())
    }

    event_cache_store_media_integration_tests!();
}