flight_test_integration_client/
flight-test-integration-client.rs1use arrow_integration_testing::flight_client_scenarios;
21use clap::Parser;
22type Error = Box<dyn std::error::Error + Send + Sync + 'static>;
23type Result<T = (), E = Error> = std::result::Result<T, E>;
24
25#[derive(clap::ValueEnum, Debug, Clone)]
26enum Scenario {
27 Middleware,
28 #[clap(name = "auth:basic_proto")]
29 AuthBasicProto,
30}
31
32#[derive(Debug, Parser)]
33#[clap(author, version, about("rust flight-test-integration-client"), long_about = None)]
34struct Args {
35 #[clap(long, help = "host of flight server")]
36 host: String,
37 #[clap(long, help = "port of flight server")]
38 port: u16,
39 #[clap(
40 short,
41 long,
42 help = "path to the descriptor file, only used when scenario is not provided. See https://arrow.apache.org/docs/format/Integration.html#json-test-data-format"
43 )]
44 path: Option<String>,
45 #[clap(long, value_enum)]
46 scenario: Option<Scenario>,
47}
48
49#[tokio::main]
50async fn main() -> Result {
51 #[cfg(feature = "logging")]
52 tracing_subscriber::fmt::init();
53
54 let args = Args::parse();
55 let host = args.host;
56 let port = args.port;
57
58 match args.scenario {
59 Some(Scenario::Middleware) => {
60 flight_client_scenarios::middleware::run_scenario(&host, port).await?
61 }
62 Some(Scenario::AuthBasicProto) => {
63 flight_client_scenarios::auth_basic_proto::run_scenario(&host, port).await?
64 }
65 None => {
66 let path = args.path.expect("No path is given");
67 flight_client_scenarios::integration_test::run_scenario(&host, port, &path).await?;
68 }
69 }
70
71 Ok(())
72}