Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewmturner committed Oct 15, 2024
1 parent 18d6581 commit 835702f
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/execution/flightsql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use tonic::{transport::Channel, IntoRequest};

use crate::config::FlightSQLConfig;

use super::local_benchmarks::FlightSQLBenchmarkStats;
use crate::execution::flightsql_benchmarks::FlightSQLBenchmarkStats;

pub type FlightSQLClient = Mutex<Option<FlightSqlServiceClient<Channel>>>;

Expand Down
2 changes: 1 addition & 1 deletion src/execution/flightsql_benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl FlightSQLBenchmarkStats {
.map(|d| d.as_nanos())
.sum::<u128>();
let percent_of_total = (this_total as f64 / total_duration as f64) * 100.0;
LocalDurationsSummary {
DurationsSummary {
min,
max,
mean,
Expand Down
42 changes: 42 additions & 0 deletions tests/extension_cases/flightsql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,45 @@ pub async fn test_time_files() {
assert.stdout(contains_str(expected));
fixture.shutdown_and_wait().await;
}

#[test]
fn test_bench_command() {
let assert = Command::cargo_bin("dft")
.unwrap()
.arg("-c")
.arg("SELECT 1")
.arg("--bench")
.arg("--flightsql")
.assert()
.success();

let expected = r##"
----------------------------
Benchmark Stats (10 runs)
----------------------------
SELECT 1
----------------------------"##;
assert.stdout(contains_str(expected));
}

#[test]
fn test_bench_files() {
let file = sql_in_file(r#"SELECT 1 + 1;"#);

let assert = Command::cargo_bin("dft")
.unwrap()
.arg("-f")
.arg(file.path())
.arg("--bench")
.arg("--flightsql")
.assert()
.success();

let expected_err = r##"
----------------------------
Benchmark Stats (10 runs)
----------------------------
SELECT 1 + 1;
----------------------------"##;
assert.code(0).stdout(contains_str(expected_err));
}

0 comments on commit 835702f

Please sign in to comment.