Skip to content

Commit 43f1a91

Browse files
committed
Remove run subcommand and flatten CLI args
1 parent cd81af4 commit 43f1a91

5 files changed

Lines changed: 17 additions & 27 deletions

File tree

.github/workflows/run_spicebench.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
2727
- name: Run spicebench
2828
run: |
29-
cargo run -p spicebench -- run \
30-
--ready-wait 180 \
31-
--concurrency 2 \
29+
cargo run -p spicebench -- \
30+
--system-adapter-http-url http://localhost:8080/rpc \
31+
--system-adapter-execution-mode direct-query \
3232
--query-set tpch

src/args/dataset.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ pub struct DataConsistencyArgs {
287287
}
288288

289289
#[derive(Parser, Debug)]
290-
pub struct LoadTestArgs {
290+
pub struct BenchRunArgs {
291291
#[command(flatten)]
292292
pub(crate) test_args: DatasetTestArgs,
293293

src/args/mod.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,10 @@ limitations under the License.
1616

1717
use std::path::PathBuf;
1818

19-
use clap::{ArgAction, Parser, Subcommand, ValueEnum};
19+
use clap::{ArgAction, Parser, ValueEnum};
2020

2121
mod dataset;
22-
pub use dataset::{DatasetTestArgs, LoadTestArgs};
23-
24-
#[derive(Subcommand)]
25-
pub enum Commands {
26-
/// Run a load test against a spiced instance
27-
Run(LoadTestArgs),
28-
}
22+
pub use dataset::{BenchRunArgs, DatasetTestArgs};
2923

3024
/// Arguments Common to all [`TestCommands`].
3125
#[derive(Parser, Debug, Clone)]

src/commands/load/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ limitations under the License.
1515
*/
1616

1717
use super::get_app_and_start_request;
18-
use crate::{args::LoadTestArgs, health::HealthMonitor, spiced_metrics::MetricsScraper};
18+
use crate::{args::BenchRunArgs, health::HealthMonitor, spiced_metrics::MetricsScraper};
1919
use std::time::Duration;
2020
use test_framework::{
2121
TestType, anyhow,
@@ -38,7 +38,7 @@ use tokio::signal;
3838
use tokio_util::sync::CancellationToken;
3939

4040
#[expect(clippy::too_many_lines)]
41-
pub(crate) async fn run(args: &LoadTestArgs) -> anyhow::Result<()> {
41+
pub(crate) async fn run(args: &BenchRunArgs) -> anyhow::Result<()> {
4242
if args.test_args.common.concurrency < 2 {
4343
return Err(anyhow::anyhow!(
4444
"Concurrency should be greater than 1 for a load test"

src/main.rs

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ mod health;
2323
mod metrics;
2424
mod spiced_metrics;
2525

26-
use args::Commands;
26+
use args::BenchRunArgs;
2727

2828
#[derive(Parser)]
2929
#[command(author, version, about, long_about = None)]
3030
struct Cli {
31-
#[command(subcommand)]
32-
subcommand: Commands,
31+
#[command(flatten)]
32+
args: BenchRunArgs,
3333
}
3434

3535
#[tokio::main]
@@ -40,17 +40,13 @@ async fn main() -> anyhow::Result<()> {
4040
let raw_cli_args: Vec<String> = std::env::args().skip(1).collect();
4141
let cli = Cli::parse();
4242

43-
match cli.subcommand {
44-
Commands::Run(args) => {
45-
if commands::maybe_dispatch_run_to_system_adapter(&raw_cli_args, &args.test_args.common)
46-
.await?
47-
{
48-
return Ok(());
49-
}
50-
51-
commands::load::run(&args).await?
52-
}
43+
if commands::maybe_dispatch_run_to_system_adapter(&raw_cli_args, &cli.args.test_args.common)
44+
.await?
45+
{
46+
return Ok(());
5347
}
5448

49+
commands::load::run(&cli.args).await?;
50+
5551
Ok(())
5652
}

0 commit comments

Comments
 (0)