testcontainers 0.27.3

A library for integration-testing against docker containers from within Rust.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::core::{client::ClientError, error::TestcontainersError};

/// Errors that can occur when working with Docker Compose
#[derive(Debug, thiserror::Error)]
pub enum ComposeError {
    #[error("Service '{0}' not found in compose stack")]
    ServiceNotFound(String),
    #[error("Testcontainers error: {0}")]
    Testcontainers(#[from] TestcontainersError),
}

pub type Result<T> = std::result::Result<T, ComposeError>;

impl From<ClientError> for ComposeError {
    fn from(err: ClientError) -> Self {
        ComposeError::Testcontainers(TestcontainersError::from(err))
    }
}