Skip to main content

bootstrap_for_tests

Function bootstrap_for_tests 

Source
pub fn bootstrap_for_tests() -> BootstrapResult<TestBootstrapSettings>
Expand description

Bootstraps PostgreSQL for integration tests and surfaces the prepared settings.

§Examples

use pg_embedded_setup_unpriv::bootstrap_for_tests;
use temp_env::with_vars;

let bootstrap = bootstrap_for_tests()?;
with_vars(bootstrap.environment.to_env(), || -> pg_embedded_setup_unpriv::BootstrapResult<()> {
    // Launch application logic that relies on `bootstrap.settings` here.
    Ok(())
})?;

§Errors

Returns an error when bootstrap preparation fails or when subprocess orchestration cannot be configured.