vdev/commands/integration/
show.rs

1use crate::commands::compose_tests::show::{exec, exec_environments_only};
2use crate::testing::config::INTEGRATION_TESTS_DIR;
3use anyhow::Result;
4use clap::Args;
5
6/// Show information about integrations
7#[derive(Args, Debug)]
8#[command()]
9pub struct Cli {
10    /// The desired integration
11    integration: Option<String>,
12
13    /// Show only the available environments (newline separated)
14    #[arg(short = 'e', long)]
15    environments_only: bool,
16}
17
18impl Cli {
19    pub fn exec(self) -> Result<()> {
20        if self.environments_only {
21            exec_environments_only(
22                &self.integration.expect("test name is required"),
23                INTEGRATION_TESTS_DIR,
24            )
25        } else {
26            exec(self.integration.as_ref(), INTEGRATION_TESTS_DIR)
27        }
28    }
29}