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 build_all: bool,
13) -> Result<()> {
14 let environment = if let Some(environment) = environment {
15 environment.clone()
16 } else {
17 let (_test_dir, config) = ComposeTestConfig::load(local_config.directory, integration)?;
18 let envs = config.environments();
19 let env = envs.keys().next().expect("Integration has no environments");
20 env.clone()
21 };
22
23 ComposeTest::generate(local_config, integration, environment, build_all, 0)?.start()
24}