blackmwk commented on code in PR #2453:
URL: https://github.com/apache/iceberg-rust/pull/2453#discussion_r3379456373


##########
crates/iceberg/src/spec/snapshot.rs:
##########
@@ -713,4 +763,57 @@ mod tests {
         assert_eq!(v2_snapshot.parent_snapshot_id(), None);
         assert_eq!(v2_snapshot.schema_id(), None);
     }
+
+    #[tokio::test]
+    async fn 
load_manifest_list_errors_when_encrypted_but_no_manager_configured() {

Review Comment:
   It's odd to me that these tests are in snapshot module. Let's move it to 
`manifest_list`'s reader module, ideally we should test the encrypted 
read/write round trip after we add support for writing encrypted manifest list.



##########
crates/iceberg/src/table.rs:
##########
@@ -441,4 +495,133 @@ mod tests {
         assert!(!table.readonly());
         assert_eq!(table.identifier.name(), "table");
     }
+
+    fn make_kms() -> Arc<dyn KeyManagementClient> {
+        let kms = MemoryKeyManagementClient::new();
+        kms.add_master_key("master-1").unwrap();
+        Arc::new(kms)
+    }
+
+    async fn write_empty_manifest_list_bytes(io: &FileIO, path: &str) -> 
bytes::Bytes {
+        let output = io.new_output(path).unwrap().writer().await.unwrap();
+        let mut writer = ManifestListWriter::v3(output, 1, None, 0, Some(0));
+        writer.add_manifests(std::iter::empty()).unwrap();
+        writer.close().await.unwrap();
+        io.new_input(path).unwrap().read().await.unwrap()
+    }
+
+    #[tokio::test]
+    async fn table_decrypts_manifest_list_via_object_cache() {

Review Comment:
   The setup in this test is odd to me, in my opinion, you could setup the 
table metadata to contain snapshot, encryption keys, etc. And only validate the 
last cache read.



-- 
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