vdev/commands/compose_tests/
start.rs1use anyhow::Result;
2
3use crate::testing::{
4 config::ComposeTestConfig,
5 integration::{ComposeTest, ComposeTestLocalConfig},
6};
7
8pub(crate) fn exec(
9 local_config: ComposeTestLocalConfig,
10 integration: &str,
11 environment: Option<&String>,
12 all_features: bool,
13 reuse_image: bool,
14) -> Result<()> {
15 let environment = if let Some(environment) = environment {
16 environment.clone()
17 } else {
18 let (_test_dir, config) = ComposeTestConfig::load(local_config.directory, integration)?;
19 let envs = config.environments();
20 trace!("Available environments: {envs:#?}");
21 let env = envs.keys().next().expect("Integration has no environments");
22 env.clone()
23 };
24 debug!("Selected environment: {environment:#?}");
25 ComposeTest::generate(
26 local_config,
27 integration,
28 environment,
29 all_features,
30 reuse_image,
31 0,
32 )?
33 .start()
34}