Expand description
Test harness for integration tests with admixture contexts.
Provides the #[admixture_test] macro for writing integration tests
with automatic context lifecycle management and lifecycle hooks.
§Example
ⓘ
use admixture::context;
use admixture_harness::prelude::*;
context! {
MyTestContext {
postgres: SqlxPostgresServiceSetup,
}
}
#[admixture_test(context = MyTestContext)]
async fn test_database_operations(ctx: &MyTestContextRunning) -> Result<(), TestError> {
let client = ctx.postgres().client().await?;
// Test logic here
Ok(())
}Re-exports§
pub use runner::ContextGroupResult;pub use runner::TestFailure;pub use runner::TestResults;pub use runner::collect_tests;pub use runner::run_all_tests_impl;pub use runner::run_context_group;
Modules§
- error
- Error types for the test harness.
- prelude
- Prelude module for convenient imports.
- runner
- Test runner that executes all registered integration tests.
Macros§
- test_
runner - Macro to generate a test runner function.
Structs§
- Hooks
- Container for lifecycle hooks with concrete context type.
- Test
Descriptor - Descriptor for a registered integration test.
Traits§
- Context
Manager - Generic context lifecycle manager trait.
Type Aliases§
- Group
Runner Fn - Type alias for group runner functions.
- HookFn
- Type alias for hook functions with Higher-Rank Trait Bounds.
- TestFn
- Type alias for test functions with Higher-Rank Trait Bounds.
Attribute Macros§
- admixture_
test - Attribute macro for integration tests with admixture contexts.