sqlness_runner/
cmd.rs

1// Copyright 2023 Greptime Team
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15pub(crate) mod bare;
16pub(crate) mod kube;
17
18use std::path::PathBuf;
19
20use bare::BareCommand;
21use clap::Parser;
22use kube::KubeCommand;
23
24#[derive(Parser)]
25#[clap(author, version, about, long_about = None)]
26pub struct Command {
27    #[clap(subcommand)]
28    pub subcmd: SubCommand,
29}
30
31#[derive(Parser)]
32pub enum SubCommand {
33    Bare(BareCommand),
34    Kube(KubeCommand),
35}
36
37#[derive(Debug, Parser)]
38pub struct SqlnessConfig {
39    /// Directory of test cases
40    #[clap(short, long)]
41    pub case_dir: Option<PathBuf>,
42
43    /// Fail this run as soon as one case fails if true
44    #[arg(short, long, default_value = "false")]
45    pub fail_fast: bool,
46
47    /// Environment Configuration File
48    #[clap(short, long, default_value = "config.toml")]
49    pub env_config_file: String,
50
51    /// Name of test cases to run. Accept as a regexp.
52    #[clap(short, long, default_value = ".*")]
53    pub test_filter: String,
54}