felipecrv commented on code in PR #39009:
URL: https://github.com/apache/arrow/pull/39009#discussion_r1414708333


##########
cpp/src/arrow/filesystem/azurefs_test.cc:
##########
@@ -287,6 +287,49 @@ class AzureFileSystemTest : public ::testing::Test {
 
   void RunGetFileInfoObjectWithNestedStructureTest();
   void RunGetFileInfoObjectTest();
+
+  void SetUpSmallFileSystemTree() {
+    // Set up test containers
+    
blob_service_client_->GetBlobContainerClient("empty-container").CreateIfNotExists();
+
+    auto container_client = 
blob_service_client_->GetBlobContainerClient("container");
+    container_client.CreateIfNotExists();
+
+    auto blob_client = container_client.GetBlockBlobClient("emptydir/");
+    blob_client.UploadFrom(reinterpret_cast<const uint8_t*>(""), 0);
+
+    blob_client = 
container_client.GetBlockBlobClient("somedir/subdir/subfile");
+    const char* sub_data = "sub data";
+    blob_client.UploadFrom(reinterpret_cast<const uint8_t*>(sub_data), 
strlen(sub_data));
+
+    blob_client = container_client.GetBlockBlobClient("somefile");
+    const char* some_data = "some data";
+    blob_client.UploadFrom(reinterpret_cast<const uint8_t*>(some_data),
+                           strlen(some_data));
+
+    blob_client = 
container_client.GetBlockBlobClient("otherdir/1/2/3/otherfile");
+    const char* other_data = "other data";
+    blob_client.UploadFrom(reinterpret_cast<const uint8_t*>(other_data),
+                           strlen(other_data));

Review Comment:
   `fs_` is the abstraction on top of the blob client, if I use the abstraction 
to produce test data bugs bugs could cancel each other out. Even when that is 
not the case, unit test failures are much harder to debug if you use the code 
being tested to also produce the ground truth test data you use to test the 
code.
   
   The s3fs tests use the S3 SDK directly to produce test data and I suppose 
it's for these reasons.



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

Reply via email to