Skip to content

Commit 8a3ea87

Browse files
authored
fix: unit test for object_storage (#16824)
* fix: unit test for object_storage * disable config&credentials
1 parent acff1b6 commit 8a3ea87

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

datafusion-cli/src/object_storage.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,9 @@ mod tests {
580580
#[tokio::test]
581581
async fn s3_object_store_builder_default() -> Result<()> {
582582
let location = "s3://bucket/path/FAKE/file.parquet";
583+
// Set it to a non-existent file to avoid reading the default configuration file
584+
std::env::set_var("AWS_CONFIG_FILE", "data/aws.config");
585+
std::env::set_var("AWS_SHARED_CREDENTIALS_FILE", "data/aws.credentials");
583586

584587
// No options
585588
let table_url = ListingTableUrl::parse(location)?;
@@ -732,6 +735,8 @@ mod tests {
732735
async fn s3_object_store_builder_resolves_region_when_none_provided() -> Result<()> {
733736
let expected_region = "eu-central-1";
734737
let location = "s3://test-bucket/path/file.parquet";
738+
// Set it to a non-existent file to avoid reading the default configuration file
739+
std::env::set_var("AWS_CONFIG_FILE", "data/aws.config");
735740

736741
let table_url = ListingTableUrl::parse(location)?;
737742
let aws_options = AwsOptions {

0 commit comments

Comments
 (0)