Skip to content

Commit

Permalink
test(aws_s3): add integration tests for new force_path_style option
Browse files Browse the repository at this point in the history
  • Loading branch information
sam6258 committed Dec 10, 2024
1 parent a04cd8f commit 9ad7f41
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/sinks/aws_cloudwatch_logs/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ async fn create_client_test() -> CloudwatchLogsClient {
let endpoint = Some(cloudwatch_address());
let proxy = ProxyConfig::default();

create_client::<CloudwatchLogsClientBuilder>(&auth, region, endpoint, &proxy, &None, &None)
create_client::<CloudwatchLogsClientBuilder>(&auth, region, endpoint, &proxy, &None, &None, true)
.await
.unwrap()
}
Expand Down
1 change: 1 addition & 0 deletions src/sinks/aws_kinesis/firehose/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ async fn firehose_client() -> aws_sdk_firehose::Client {
&proxy,
&None,
&None,
true,
)
.await
.unwrap()
Expand Down
1 change: 1 addition & 0 deletions src/sinks/aws_kinesis/streams/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ async fn client() -> aws_sdk_kinesis::Client {
&proxy,
&None,
&None,
true,
)
.await
.unwrap()
Expand Down
22 changes: 22 additions & 0 deletions src/sinks/aws_s3/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,25 @@ async fn s3_healthchecks() {
.unwrap();
}

#[tokio::test]
async fn s3_healthchecks_vhost() {
let bucket = uuid::Uuid::new_v4().to_string();

create_bucket(&bucket, false).await;

let mut config = config(&bucket,1);
config.force_path_style = false;
let service = config
.create_service(&ProxyConfig::from_env())
.await
.unwrap();
config
.build_healthcheck(service.client())
.unwrap()
.await
.unwrap();
}

#[tokio::test]
async fn s3_healthchecks_invalid_bucket() {
let config = config("s3_healthchecks_invalid_bucket", 1);
Expand Down Expand Up @@ -438,6 +457,7 @@ async fn s3_flush_on_exhaustion() {
auth: Default::default(),
acknowledgements: Default::default(),
timezone: Default::default(),
force_path_style: Default::default(),
}
};
let prefix = config.key_prefix.clone();
Expand Down Expand Up @@ -496,6 +516,7 @@ async fn client() -> S3Client {
&proxy,
&tls_options,
&None,
true,
)
.await
.unwrap()
Expand All @@ -522,6 +543,7 @@ fn config(bucket: &str, batch_size: usize) -> S3SinkConfig {
auth: Default::default(),
acknowledgements: Default::default(),
timezone: Default::default(),
force_path_style: Default::default(),
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/sinks/aws_s_s/sns/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ async fn create_sns_test_client() -> SnsClient {
&proxy,
&None,
&None,
true,
)
.await
.unwrap()
Expand All @@ -59,6 +60,7 @@ async fn create_sqs_test_client() -> SqsClient {
&proxy,
&None,
&None,
true,
)
.await
.unwrap()
Expand Down
1 change: 1 addition & 0 deletions src/sinks/aws_s_s/sqs/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ async fn create_test_client() -> SqsClient {
&proxy,
&None,
&None,
true,
)
.await
.unwrap()
Expand Down
1 change: 1 addition & 0 deletions src/sources/aws_s3/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,7 @@ mod integration_tests {
&proxy_config,
&None,
&None,
true,
)
.await
.unwrap()
Expand Down

0 comments on commit 9ad7f41

Please sign in to comment.