Skip to content

Commit

Permalink
test: add test for FlightSQL CLI client
Browse files Browse the repository at this point in the history
Closes #3814.
  • Loading branch information
crepererum committed Mar 7, 2023
1 parent 6678b23 commit f4836b5
Show file tree
Hide file tree
Showing 3 changed files with 556 additions and 1 deletion.
1 change: 1 addition & 0 deletions arrow-flight/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ cli = ["arrow/prettyprint", "clap", "tracing-log", "tracing-subscriber", "tonic/

[dev-dependencies]
arrow = { version = "34.0.0", path = "../arrow", features = ["prettyprint"] }
assert_cmd = "2.0.8"
tempfile = "3.3"
tokio-stream = { version = "0.1", features = ["net"] }
tower = "0.4.13"
Expand Down
4 changes: 3 additions & 1 deletion arrow-flight/src/bin/flight_sql_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ fn setup_logging() {
async fn setup_client(args: ClientArgs) -> Result<FlightSqlServiceClient> {
let port = args.port.unwrap_or(if args.tls { 443 } else { 80 });

let mut endpoint = Endpoint::new(format!("https://{}:{}", args.host, port))
let protocol = if args.tls { "https" } else { "http" };

let mut endpoint = Endpoint::new(format!("{}://{}:{}", protocol, args.host, port))
.map_err(|_| ArrowError::IoError("Cannot create endpoint".to_string()))?
.connect_timeout(Duration::from_secs(20))
.timeout(Duration::from_secs(20))
Expand Down
Loading

0 comments on commit f4836b5

Please sign in to comment.