Tom-Newton commented on code in PR #39263:
URL: https://github.com/apache/arrow/pull/39263#discussion_r1430076256
##########
cpp/src/arrow/filesystem/azurefs_test.cc:
##########
@@ -266,15 +263,12 @@ class AzureHierarchicalNSEnv : public
AzureEnvImpl<AzureHierarchicalNSEnv> {
bool WithHierarchicalNamespace() const final { return true; }
};
-// Placeholder tests
-// TODO: GH-18014 Remove once a proper test is added
-TEST(AzureFileSystem, InitializeCredentials) {
- auto default_credential =
std::make_shared<Azure::Identity::DefaultAzureCredential>();
- auto managed_identity_credential =
- std::make_shared<Azure::Identity::ManagedIdentityCredential>();
- auto service_principal_credential =
- std::make_shared<Azure::Identity::ClientSecretCredential>("tenant_id",
"client_id",
-
"client_secret");
+TEST(AzureFileSystem, InitialiseFilesystemWithDefaultCredential) {
+ AzureOptions options;
+ options.backend = AzureBackend::kAzurite; // Irrelevant for this test
because it
+ // doesn't connect to the server.
+ ARROW_EXPECT_OK(options.ConfigureDefaultCredential("dummy-account-name"));
+ EXPECT_OK_AND_ASSIGN(auto default_credential_fs,
AzureFileSystem::Make(options));
Review Comment:
It would definitely be possible to test against real blob storage but there
will be a significant amount of manual configuration for all the identities to
test all the different authentications.
Then we need to provide details of these identities to
`TestAzureHierarchicalNSFileSystem` either they are required always or we need
to add new versions for each auth e.g.
`TestAzureHierarchicalNSFileSystemWithServicePrincipal`.
Also there are some Auth methods that are not feasible to test. For example
managed identity can only work on Azure VMs and workload identity can only work
in kubernetes.
Personally I don't think this is worthwhile to make a more comprehensive
test because of how little complexity there is outside the Azure SDK.
--
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]