If you are implementing a new storage layer for AKD, you can leverage the existing suite of standard storage tests by enabling the public_tests feature in the akd crate.
- Setup Dev-Dependency: Add
akd to your [dev-dependencies] with the public_tests and serde features enabled. - Run Test Suite: Initialize your storage implementation and pass it to
akd::storage::tests::run_test_cases_for_storage_impl. This function will panic if an error occurs, providing a stack trace.
Configuration (Cargo.toml):
[dev-dependencies]
akd = { path = "../akd", version = "^0.5.0", features = ["public_tests", "serde"] }
#[tokio::test]
async fn my_new_storage_tests() {
// setup
let storage = ...;
// Run the test cases (will panic if error occurs so you get a stack trace)
akd::storage::tests::run_test_cases_for_storage_impl(&storage).await;
// teardown / cleanup (if necessary)
}