use crate::common::{Test, TestBatchConfig};
use thiserror::Error;
#[derive(Error, Debug)]
pub enum IntegrationTestError {
#[error("The integration test is itself incorrectly specified: {0}")]
FaultyTest(String),
#[error("Unexpected value from running test: expect {0}, actual {1}")]
ExpectedValueMismatch(String, String),
#[error("Modelator returned an error: {0}")]
Modelator(#[from] modelator::Error),
#[error("Clap returned an error: {0}")]
Clap(#[from] clap::Error),
#[error("Serde returned an error: {0}")]
Serde(#[from] serde_json::Error),
}
#[derive(Error, Debug)]
#[error(
"Test '{0}' in batch '{1}' failed. [name:{2}, batch_name:{3}, description:{4}] Error: {5}",
test.name,
batch_config.name,
test.name,
batch_config.name,
batch_config.description,
error_str
)]
pub struct IntegrationTestFailure {
pub error_str: String,
pub test: Test,
pub batch_config: TestBatchConfig,
}