This is an automated email from the ASF dual-hosted git repository.

kevinjqliu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-go.git


The following commit(s) were added to refs/heads/main by this push:
     new ed2a18f1 Fix Azure credential test that fails when az is logged in 
(#1095)
ed2a18f1 is described below

commit ed2a18f1e2acd6dc2ce960de1f06441a20eda487
Author: Kevin Liu <[email protected]>
AuthorDate: Tue May 19 15:06:06 2026 -0400

    Fix Azure credential test that fails when az is logged in (#1095)
    
    `TestCreateAzureBucketDefaultCredentialCalled` fails when Azure
    credentials are present on the machine (e.g., via `az login`).
    
    When `DefaultAzureCredential` succeeds in creating a client, the `List`
    operation returns an Azure service error (e.g.,
    `AuthorizationPermissionMismatch`) that does not contain
    "DefaultAzureCredential". The assertion was checking for a string that
    can never appear in this code path.
    
    Removed the incorrect `assert.Contains` on the List error. The test
    still validates that `DefaultAzureCredential` is used (via the creation
    error path or non-nil bucket assertion).
---
 io/gocloud/azure_test.go | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/io/gocloud/azure_test.go b/io/gocloud/azure_test.go
index faa5cf58..cb1404e0 100644
--- a/io/gocloud/azure_test.go
+++ b/io/gocloud/azure_test.go
@@ -46,14 +46,11 @@ func TestCreateAzureBucketDefaultCredentialCalled(t 
*testing.T) {
        // If bucket creation succeeds, verify we can't actually use it without 
proper auth
        assert.NotNil(t, bucket, "Bucket should be created when 
DefaultAzureCredential client creation succeeds")
 
-       // Test that actual operations fail with DefaultAzureCredential auth 
errors
+       // Test that actual operations fail with auth errors against the fake 
account
        iter := bucket.List(nil)
        _, err = iter.Next(ctx)
 
        assert.Error(t, err, "Expected List to return an error when List is 
called")
-       // This is expected - we should get an auth error when trying to 
actually use the bucket
-       assert.Contains(t, err.Error(), "DefaultAzureCredential",
-               "Expected DefaultAzureCredential error when listing objects but 
got: %v", err)
 }
 
 func TestCreateAzureBucketDefaultCredentialEmptyBucketName(t *testing.T) {

Reply via email to