pub struct Test {
pub configs: TypeMap,
pub compositions: Vec<Composition>,
}
Expand description
A single test which brings up one or more Servers.
A Test receives Configs via register
which
determines the servers that will be brought up when the test is executed.
The run
method is used to bring up the Servers and then run the
given test body.
The body of a test is determined by an async closure passed to the run
method. The closure will receive a TestInstance which can be used to
access the Servers that were created when the test was setup.
Fields§
§configs: TypeMap
§compositions: Vec<Composition>
Implementations§
Source§impl Test
impl Test
Sourcepub fn run<T, F>(self, fun: T)
pub fn run<T, F>(self, fun: T)
Brings up the Servers registered with this test and then runs the given test body.
The test body receives a TestInstance which can be used for accessing
any configured Servers through the server
method.
The test body is guaranteed to not execute until all configured
Servers are verified to be running and available. The scope of
the test body determines the life of the Servers: they are
created before the closure is run and destroyed after the closure exits.