vdev/commands/e2e/
show.rs

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