pub fn new(builder_name: impl Into<String>, app_dir: impl AsRef<Path>) -> Self {
        let tokio_runtime =
            tokio::runtime::Runtime::new().expect("Could not create internal Tokio runtime");

        let docker = match env::var("DOCKER_HOST") {
            #[cfg(target_family = "unix")]
            Ok(docker_host) if docker_host.starts_with("unix://") => {
                Docker::connect_with_unix_defaults()
            }
            Ok(docker_host)
                if docker_host.starts_with("tcp://") || docker_host.starts_with("https://") =>
            {
                Docker::connect_with_ssl_defaults()
            }
            Ok(docker_host) => panic!(
                "Cannot connect to unsupported DOCKER_HOST '{}'",
                docker_host
            ),
            Err(VarError::NotPresent) => Docker::connect_with_local_defaults(),
            Err(VarError::NotUnicode(_)) => {
                panic!("DOCKER_HOST environment variable is not unicode encoded!")
            }
        }
        .expect("Could not connect to local Docker daemon");

        IntegrationTest {
            app_dir: PathBuf::from(app_dir.as_ref()),
            target_triple: String::from("x86_64-unknown-linux-musl"),
            builder_name: builder_name.into(),
            buildpacks: vec![BuildpackReference::Crate],
            docker,
            tokio_runtime,
        }
    }
/// Creates a new integration test.
///
/// # Panics
/// - When the connection to Docker failed
/// - When the internal Tokio runtime could not be created
Creates a new integration test.
Creates a new integration test .
pub fn new(builder_name: impl Into<String>, app_dir: impl AsRef<Path>) -> Self {
        let tokio_runtime =
            tokio::runtime::Runtime::new().expect("Could not create internal Tokio runtime");
        let docker = match env::var("DOCKER_HOST") {
            #[cfg(target_family = "unix")]
            Ok(docker_host) if docker_host.starts_with("unix://") => {
                Docker::connect_with_unix_defaults()
            }
            Ok(docker_host)
                if docker_host.starts_with("tcp://") || docker_host.starts_with("https://") =>
            {
                Docker::connect_with_ssl_defaults()
            }
            Ok(docker_host) => panic!(
                "Cannot connect to unsupported DOCKER_HOST '{}'",
                docker_host
            ),
            Err(VarError::NotPresent) => Docker::connect_with_local_defaults(),
            Err(VarError::NotUnicode(_)) => {
                panic!("DOCKER_HOST environment variable is not unicode encoded!")
            }
        }
        .expect("Could not connect to local Docker daemon");
        IntegrationTest {
            app_dir: PathBuf::from(app_dir.as_ref()),
            target_triple: String::from("x86_64-unknown-linux-musl"),
            builder_name: builder_name.into(),
            buildpacks: vec![BuildpackReference::Crate],
            docker,
            tokio_runtime,
        }
    }
pub fn new ( builder_name : impl Into < String > , app_dir : impl AsRef < Path > ) -> Self { let tokio_runtime = tokio :: runtime :: Runtime :: new ( ) . expect ( " " ) ; let docker = match env :: var ( " " ) { # [ cfg ( target_family " " ) ] Ok ( docker_host ) if docker_host . starts_with ( " " ) => { Docker :: connect_with_unix_defaults ( ) } Ok ( docker_host ) if docker_host . starts_with ( " " ) || docker_host . starts_with ( " " ) => { Docker :: connect_with_ssl_defaults ( ) } Ok ( docker_host ) => panic ! ( " " docker_host ) , Err ( VarError :: NotPresent ) => Docker :: connect_with_local_defaults ( ) , Err ( VarError :: NotUnicode ( _ ) ) => { panic ! ( " " ) } } . expect ( " " ) ; IntegrationTest { app_dir : PathBuf :: from ( app_dir . as_ref ( ) ) , target_triple : String :: from ( " " ) , builder_name : builder_name . into ( ) , buildpacks : vec ! [ BuildpackReference Crate ] , docker , tokio_runtime , } }
Creates a new integration test.
Creates a new integration test .
builder_name
impl Into<String>
app_dir
impl AsRef<Path>
builder_name
impl Into<String>
app_dir
impl AsRef<Path>
panics
When the connection to Docker failed
When the internal Tokio runtime could not be created
When the connection to Docker failed When the internal Tokio runtime could not be created