vdev/commands/e2e/
show.rs

1use crate::commands::compose_tests::show::{exec, exec_environments_only};
2use crate::testing::config::E2E_TESTS_DIR;
3use anyhow::Result;
4use clap::Args;
5
6/// Show information about e2e-tests
7#[derive(Args, Debug)]
8#[command()]
9pub struct Cli {
10    /// The desired e2e test name
11    test: 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(&self.test.expect("test name is required"), E2E_TESTS_DIR)
22        } else {
23            exec(self.test.as_ref(), E2E_TESTS_DIR)
24        }
25    }
26}