Skip to content

Commit

Permalink
feat(sqlsmith): refactor test runners (#14405)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwannoel authored Jan 8, 2024
1 parent 322c24d commit d2f1baf
Show file tree
Hide file tree
Showing 9 changed files with 777 additions and 688 deletions.
15 changes: 10 additions & 5 deletions src/tests/simulation/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ async fn main() {
.await
.unwrap();
if let Some(outdir) = args.generate_sqlsmith_queries {
risingwave_sqlsmith::runner::generate(
risingwave_sqlsmith::test_runners::generate(
rw.pg_client(),
&args.files,
count,
Expand All @@ -212,7 +212,7 @@ async fn main() {
return;
}
if args.run_differential_tests {
risingwave_sqlsmith::runner::run_differential_testing(
risingwave_sqlsmith::test_runners::run_differential_testing(
rw.pg_client(),
&args.files,
count,
Expand All @@ -223,8 +223,13 @@ async fn main() {
return;
}

risingwave_sqlsmith::runner::run(rw.pg_client(), &args.files, count, Some(seed))
.await;
risingwave_sqlsmith::test_runners::run(
rw.pg_client(),
&args.files,
count,
Some(seed),
)
.await;
})
.await;
return;
Expand All @@ -237,7 +242,7 @@ async fn main() {
let rw = RisingWave::connect("frontend".into(), "dev".into())
.await
.unwrap();
risingwave_sqlsmith::runner::run_pre_generated(rw.pg_client(), &outdir).await;
risingwave_sqlsmith::test_runners::run_pre_generated(rw.pg_client(), &outdir).await;
})
.await;
return;
Expand Down
2 changes: 1 addition & 1 deletion src/tests/sqlsmith/src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use std::time::Duration;

use clap::Parser as ClapParser;
use risingwave_sqlsmith::print_function_table;
use risingwave_sqlsmith::runner::{generate, run, run_differential_testing};
use risingwave_sqlsmith::test_runners::{generate, run, run_differential_testing};
use tokio_postgres::NoTls;

#[derive(ClapParser, Debug, Clone)]
Expand Down
2 changes: 1 addition & 1 deletion src/tests/sqlsmith/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ use risingwave_sqlparser::parser::Parser;
use crate::sql_gen::SqlGenerator;

pub mod reducer;
pub mod runner;
mod sql_gen;
pub mod test_runners;
mod utils;
pub mod validation;
pub use validation::is_permissible_error;
Expand Down
Loading

0 comments on commit d2f1baf

Please sign in to comment.