pub struct TestInstance {
pub instance: DockerTest,
}Expand description
A single test instance made up of several Compositions which are brought up for executing tests.
Use the run method to run the containers and perform the test logic.
Fields§
§instance: DockerTestImplementations§
Source§impl TestInstance
impl TestInstance
Sourcepub fn new(servers: Vec<Composition>) -> TestInstance
pub fn new(servers: Vec<Composition>) -> TestInstance
Returns a new TestInstance configured with the given Compositions.
Sourcepub fn add(&mut self, comp: Composition)
pub fn add(&mut self, comp: Composition)
Adds a Composition to this TestInstance.
Sourcepub fn run<T, F>(self, fun: T)
pub fn run<T, F>(self, fun: T)
Runs all containers from the associated Compositions, verifying they are running according to their startup conditions, and then calls the passed closure with runtime details.
This is the main method for running the TestInstance. All test logic should be encompassed within the passed closure. Creating and destroying containers happens upon entering/leaving the closure.
Auto Trait Implementations§
impl Freeze for TestInstance
impl !RefUnwindSafe for TestInstance
impl !Send for TestInstance
impl !Sync for TestInstance
impl Unpin for TestInstance
impl !UnwindSafe for TestInstance
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
Mutably borrows from an owned value. Read more