MCPcopy Create free account
hub / github.com/apache/datafusion / test_aws_options

Function test_aws_options

datafusion-cli/tests/cli_integration.rs:343–380  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

341
342#[tokio::test]
343async fn test_aws_options() {
344 // Separate test is needed to pass aws as options in sql and not via env
345
346 if env::var("TEST_STORAGE_INTEGRATION").is_err() {
347 eprintln!("Skipping external storages integration tests");
348 return;
349 }
350
351 let settings = make_settings();
352 let _bound = settings.bind_to_scope();
353
354 let container = match setup_minio_container().await {
355 Ok(c) => c,
356 Err(e) if e.contains("toomanyrequests") => {
357 eprintln!("Skipping test: Docker pull rate limit reached: {e}");
358 return;
359 }
360 e @ Err(_) => e.unwrap(),
361 };
362 let port = container.get_host_port_ipv4(9000).await.unwrap();
363
364 let input = format!(
365 r#"CREATE EXTERNAL TABLE CARS
366STORED AS CSV
367LOCATION 's3://data/cars.csv'
368OPTIONS(
369 'aws.access_key_id' 'TEST-DataFusionLogin',
370 'aws.secret_access_key' 'TEST-DataFusionPassword',
371 'aws.endpoint' 'http://localhost:{port}',
372 'aws.allow_http' 'true'
373);
374
375SELECT * FROM CARS limit 1;
376"#
377 );
378
379 assert_cmd_snapshot!(cli().env_clear().pass_stdin(input));
380}
381
382#[tokio::test]
383async fn test_aws_region_auto_resolution() {

Callers

nothing calls this directly

Calls 4

setup_minio_containerFunction · 0.85
is_errMethod · 0.80
make_settingsFunction · 0.70
containsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…