Tom-Newton commented on code in PR #38505:
URL: https://github.com/apache/arrow/pull/38505#discussion_r1384123947


##########
cpp/src/arrow/filesystem/azurefs_test.cc:
##########
@@ -216,23 +226,184 @@ class TestAzureFileSystem : public ::testing::Test {
   void UploadLines(const std::vector<std::string>& lines, const char* 
path_to_file,
                    int total_size) {
     // TODO(GH-38333): Switch to using Azure filesystem to write once its 
implemented.
-    auto blob_client = 
service_client_->GetBlobContainerClient(PreexistingContainerName())
-                           .GetBlockBlobClient(path_to_file);
+    auto blob_client =
+        
blob_service_client_->GetBlobContainerClient(PreexistingContainerName())
+            .GetBlockBlobClient(path_to_file);
     std::string all_lines = std::accumulate(lines.begin(), lines.end(), 
std::string(""));
     blob_client.UploadFrom(reinterpret_cast<const uint8_t*>(all_lines.data()),
                            total_size);
   }
+
+  void RunGetFileInfoObjectWithNestedStructureTest();
+  void RunGetFileInfoObjectTest();
 };
 
-TEST_F(TestAzureFileSystem, OpenInputStreamString) {
+class AzuriteFileSystemTest : public AzureFileSystemTest {
+  Result<AzureOptions> MakeOptions() {
+    EXPECT_THAT(GetAzuriteEnv(), NotNull());
+    ARROW_EXPECT_OK(GetAzuriteEnv()->status());
+    AzureOptions options;
+    options.backend = AzureBackend::Azurite;
+    ARROW_EXPECT_OK(options.ConfigureAccountKeyCredentials(
+        GetAzuriteEnv()->account_name(), GetAzuriteEnv()->account_key()));
+    return options;
+  }
+};
+
+class AzureFlatNamespaceFileSystemTest : public AzureFileSystemTest {
+  Result<AzureOptions> MakeOptions() override {
+    AzureOptions options;
+    if (char* account_name = std::getenv("AZURE_FLAT_NAMESPACE_ACCOUNT_NAME")) 
{
+      char* account_key = std::getenv("AZURE_FLAT_NAMESPACE_ACCOUNT_KEY");
+      EXPECT_THAT(account_key, NotNull());
+      ARROW_EXPECT_OK(options.ConfigureAccountKeyCredentials(account_name, 
account_key));

Review Comment:
   I switched to `RETURN_NOT_OK()` but I don't think it makes a lot of 
difference because `ConfigureAccountKeyCredentials` actually segfaults 
somewhere in the Azure SDK if either `account_name` or `account_key` is null. I 
don't think I can use `ASSERT_` because the function does not return `void`. 
   
   I adjusted the logic slightly so that the tests are skipped if either of 
`account_name` or `account_key` is null. 



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