From 58c80e6d7dd67b2929bec084d8baa7b08069fd39 Mon Sep 17 00:00:00 2001 From: Raphael Taylor-Davies <1781103+tustvold@users.noreply.github.com> Date: Tue, 28 Nov 2023 15:38:00 +0000 Subject: [PATCH] Update localstack to 3.0.1 (#5028) --- .github/workflows/object_store.yml | 2 +- object_store/src/aws/mod.rs | 8 +++----- object_store/src/azure/mod.rs | 2 +- object_store/src/http/mod.rs | 2 +- object_store/src/lib.rs | 18 +++++++----------- 5 files changed, 13 insertions(+), 19 deletions(-) diff --git a/.github/workflows/object_store.yml b/.github/workflows/object_store.yml index 1b991e33c097..ecffa29b067c 100644 --- a/.github/workflows/object_store.yml +++ b/.github/workflows/object_store.yml @@ -133,7 +133,7 @@ jobs: - name: Setup LocalStack (AWS emulation) run: | - docker run -d -p 4566:4566 localstack/localstack:2.0 + docker run -d -p 4566:4566 localstack/localstack:3.0.1 docker run -d -p 1338:1338 amazon/amazon-ec2-metadata-mock:v1.9.2 --imdsv2 aws --endpoint-url=http://localhost:4566 s3 mb s3://test-bucket diff --git a/object_store/src/aws/mod.rs b/object_store/src/aws/mod.rs index cbb3cffdf494..0985263459b2 100644 --- a/object_store/src/aws/mod.rs +++ b/object_store/src/aws/mod.rs @@ -336,12 +336,10 @@ mod tests { let integration = config.build().unwrap(); let config = integration.client.config(); - let is_local = config.endpoint.starts_with("http://"); let test_not_exists = config.copy_if_not_exists.is_some(); let test_conditional_put = config.conditional_put.is_some(); - // Localstack doesn't support listing with spaces https://github.com/localstack/localstack/issues/6328 - put_get_delete_list_opts(&integration, is_local).await; + put_get_delete_list_opts(&integration).await; get_opts(&integration).await; list_uses_directories_correctly(&integration).await; list_with_delimiter(&integration).await; @@ -364,12 +362,12 @@ mod tests { // run integration test with unsigned payload enabled let builder = AmazonS3Builder::from_env().with_unsigned_payload(true); let integration = builder.build().unwrap(); - put_get_delete_list_opts(&integration, is_local).await; + put_get_delete_list_opts(&integration).await; // run integration test with checksum set to sha256 let builder = AmazonS3Builder::from_env().with_checksum_algorithm(Checksum::SHA256); let integration = builder.build().unwrap(); - put_get_delete_list_opts(&integration, is_local).await; + put_get_delete_list_opts(&integration).await; } #[tokio::test] diff --git a/object_store/src/azure/mod.rs b/object_store/src/azure/mod.rs index 1d51cbdc02dc..af0a4cefa13b 100644 --- a/object_store/src/azure/mod.rs +++ b/object_store/src/azure/mod.rs @@ -193,7 +193,7 @@ mod tests { crate::test_util::maybe_skip_integration!(); let integration = MicrosoftAzureBuilder::from_env().build().unwrap(); - put_get_delete_list_opts(&integration, false).await; + put_get_delete_list_opts(&integration).await; get_opts(&integration).await; list_uses_directories_correctly(&integration).await; list_with_delimiter(&integration).await; diff --git a/object_store/src/http/mod.rs b/object_store/src/http/mod.rs index cfcde27fd781..f1d11db4762c 100644 --- a/object_store/src/http/mod.rs +++ b/object_store/src/http/mod.rs @@ -264,7 +264,7 @@ mod tests { .build() .unwrap(); - put_get_delete_list_opts(&integration, false).await; + put_get_delete_list_opts(&integration).await; list_uses_directories_correctly(&integration).await; list_with_delimiter(&integration).await; rename_and_copy(&integration).await; diff --git a/object_store/src/lib.rs b/object_store/src/lib.rs index 40dca8f756d2..5c5c70de3a2b 100644 --- a/object_store/src/lib.rs +++ b/object_store/src/lib.rs @@ -1236,13 +1236,10 @@ mod tests { use tokio::io::AsyncWriteExt; pub(crate) async fn put_get_delete_list(storage: &DynObjectStore) { - put_get_delete_list_opts(storage, false).await + put_get_delete_list_opts(storage).await } - pub(crate) async fn put_get_delete_list_opts( - storage: &DynObjectStore, - skip_list_with_spaces: bool, - ) { + pub(crate) async fn put_get_delete_list_opts(storage: &DynObjectStore) { delete_fixtures(storage).await; let content_list = flatten_list_stream(storage, None).await.unwrap(); @@ -1483,12 +1480,11 @@ mod tests { storage.put(&path, Bytes::from(vec![0, 1])).await.unwrap(); storage.head(&path).await.unwrap(); - if !skip_list_with_spaces { - let files = flatten_list_stream(storage, Some(&Path::from("foo bar"))) - .await - .unwrap(); - assert_eq!(files, vec![path.clone()]); - } + let files = flatten_list_stream(storage, Some(&Path::from("foo bar"))) + .await + .unwrap(); + assert_eq!(files, vec![path.clone()]); + storage.delete(&path).await.unwrap(); let files = flatten_list_stream(storage, None).await.unwrap();