laskoviymishka commented on code in PR #3288:
URL: https://github.com/apache/iceberg-rust/pull/3288#discussion_r4187831265


##########
crates/storage/common/tests/resolving_suite.rs:
##########
@@ -0,0 +1,418 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+//! OpenDAL resolving storage integration tests.
+
+mod common;
+
+use std::sync::Arc;
+
+use bytes::Bytes;
+use common::{StorageKind, load_storage, unique_path};
+use iceberg::io::{FileIO, FileIOBuilder, S3_ENDPOINT, S3_PATH_STYLE_ACCESS, 
S3_REGION};
+use iceberg_storage_opendal::{
+    AwsCredential, CustomAwsCredentialLoader, OpenDalResolvingStorageFactory, 
ProvideCredential,
+};
+use iceberg_test_utils::{get_object_store_endpoint, set_up};
+use reqsign_core::Context;
+use rstest::rstest;
+use tempfile::TempDir;
+
+fn roundtrip_file_io(file_io: &FileIO) -> FileIO {

Review Comment:
   This re-implements the `roundtrip_file_io` we already export from 
`src/file_io.rs` — I'd import the shared one and delete the local copy. Same 
story for the `.unwrap()` chain through these tests: they already return 
`iceberg::Result<()>`, so `?` is the cleanup we did in `file_io.rs` and it's 
worth finishing here too.



##########
crates/storage/common/Cargo.toml:
##########
@@ -0,0 +1,48 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+[package]
+edition = { workspace = true }
+homepage = { workspace = true }
+license = { workspace = true }
+name = "iceberg-storage-common"
+repository = { workspace = true }
+rust-version = { workspace = true }
+version = { workspace = true }
+
+categories = ["database"]
+description = "Apache Iceberg Storage Common Test Suite"
+keywords = ["iceberg", "storage"]
+publish = false
+
+[dependencies]
+bytes = { workspace = true }
+futures = { workspace = true }
+iceberg = { workspace = true }
+iceberg_test_utils = { path = "../../test_utils", features = ["tests"] }
+reqwest = { workspace = true }
+tempfile = { workspace = true }
+tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
+
+[dev-dependencies]
+anyhow = { workspace = true }

Review Comment:
   Nothing in the crate references `anyhow`, and this same PR drops it from the 
opendal crate — cargo-machete will flag it and turn CI red, so I'd pull it from 
the dev-deps.



##########
crates/storage/common/Cargo.toml:
##########
@@ -0,0 +1,48 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+[package]
+edition = { workspace = true }
+homepage = { workspace = true }
+license = { workspace = true }
+name = "iceberg-storage-common"
+repository = { workspace = true }
+rust-version = { workspace = true }
+version = { workspace = true }
+
+categories = ["database"]
+description = "Apache Iceberg Storage Common Test Suite"
+keywords = ["iceberg", "storage"]
+publish = false
+
+[dependencies]
+bytes = { workspace = true }
+futures = { workspace = true }
+iceberg = { workspace = true }
+iceberg_test_utils = { path = "../../test_utils", features = ["tests"] }
+reqwest = { workspace = true }
+tempfile = { workspace = true }
+tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }

Review Comment:
   I'd spell out the tokio features this crate actually uses — `time` for the 
probe's `sleep`, and `net` + `io-util` for the `TcpListener`/`AsyncWrite` in 
the probe tests. Right now it only builds because workspace feature unification 
pulls those in; `cargo check -p iceberg-storage-common` on its own would fail.



##########
Makefile:
##########
@@ -17,6 +17,8 @@
 
 .EXPORT_ALL_VARIABLES:
 
+ICEBERG_REQUIRE_STORAGE ?= 1

Review Comment:
   Not blocking, but `?= 1` with `.EXPORT_ALL_VARIABLES` exports to every 
target, so `make build && cargo test` or a bare `make nextest` hard-fail for 
anyone without docker up — only `make test` runs docker-up. I'd set it on the 
test recipe instead (`ICEBERG_REQUIRE_STORAGE=1 $(MAKE) nextest`) so the 
default flow still works.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to