Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update localstack #5028

Merged
merged 1 commit into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/object_store.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 3 additions & 5 deletions object_store/src/aws/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

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;
Expand All @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion object_store/src/azure/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion object_store/src/http/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
18 changes: 7 additions & 11 deletions object_store/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
Loading