Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions rust/benchmarks/src/bin/tpch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,3 +353,39 @@ fn get_schema(table: &str) -> Schema {
_ => unimplemented!(),
}
}

#[cfg(test)]
mod tests {
use super::*;
use std::env;

#[tokio::test]
async fn q1() -> Result<()> {
verify_query(1).await
}

#[tokio::test]
async fn q12() -> Result<()> {
verify_query(12).await
}

async fn verify_query(n: usize) -> Result<()> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe also test the mem_table / some other options by adding at as parameter in verify_query ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would help to document here the expectations (e.g. copy the description from the PR as comments).

if let Ok(path) = env::var("TPCH_DATA") {
let opt = BenchmarkOpt {
query: n,
debug: false,
iterations: 1,
concurrency: 2,
batch_size: 4096,
path: PathBuf::from(path),
file_format: "tbl".to_string(),
mem_table: false,
};
benchmark(opt).await?
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have a duplicate }

} else {
println!("TPCH_DATA environment variable not set, skipping test")
}
Ok(())
}
}