Allows your integration tests to run your application under a separate process and assert on tracing events.
To achieve this, it locates or builds the application's executable,
runs it with tracing in JSON mode,
and then processes the JSON logs to both assert on and display in human readable form.
It is a little opinionated and by default will fail the test when a tracing warning or error occurs.
However a specific warning or error can be allowed on a per test basis.
Example usage for an imaginary database project named cooldb:
use Level;
use ;
use EventMatcher;
use Duration;
use PathBuf;
# // hack to make the doc test compile
#
/// you'll want a helper like this as you'll be creating this in every integration test.
async
async
When Cargo builds integration tests or benchmarks it provides a path to the binary under test.
We can make use of that for speed and robustness with [BinProcessBuilder::from_path].
But that is not always flexible enough so as a fallback [BinProcess] can invoke Cargo again internally to ensure the binary we need is compiled via [BinProcessBuilder::from_cargo_name].