Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix failing integration tests #2832

Merged
merged 2 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions pkg/sdk/testint/grants_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ func TestInt_GrantAndRevokePrivilegesToAccountRole(t *testing.T) {
},
})
require.NoError(t, err)
assert.Equal(t, 1, len(grants))
assert.Equal(t, sdk.SchemaObjectPrivilegeSelect.String(), grants[0].Privilege)
assert.Equal(t, tableTest.ID().FullyQualifiedName(), grants[0].Name.FullyQualifiedName())
selectPrivilege, err := collections.FindOne[sdk.Grant](grants, func(g sdk.Grant) bool { return g.Privilege == sdk.SchemaObjectPrivilegeSelect.String() })
require.NoError(t, err)
assert.Equal(t, tableTest.ID().FullyQualifiedName(), selectPrivilege.Name.FullyQualifiedName())

// now revoke and verify that the grant(s) are gone
err = client.Grants.RevokePrivilegesFromAccountRole(ctx, privileges, on, roleTest.ID(), nil)
Expand Down Expand Up @@ -511,8 +511,7 @@ func TestInt_GrantAndRevokePrivilegesToDatabaseRole(t *testing.T) {
})
require.NoError(t, err)
// Expecting two grants because database role has usage on database by default
require.Equal(t, 2, len(returnedGrants))
sfc-gh-asawicki marked this conversation as resolved.
Show resolved Hide resolved

require.LessOrEqual(t, 2, len(returnedGrants))
usagePrivilege, err := collections.FindOne[sdk.Grant](returnedGrants, func(g sdk.Grant) bool { return g.Privilege == sdk.AccountObjectPrivilegeUsage.String() })
require.NoError(t, err)
assert.Equal(t, sdk.ObjectTypeDatabaseRole, usagePrivilege.GrantedTo)
Expand Down
3 changes: 1 addition & 2 deletions pkg/sdk/testint/row_access_policies_gen_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,7 @@ func TestInt_RowAccessPolicies(t *testing.T) {
showRequest := sdk.NewShowRowAccessPolicyRequest()
returnedRowAccessPolicies, err := client.RowAccessPolicies.Show(ctx, showRequest)
require.NoError(t, err)

assert.Equal(t, 2, len(returnedRowAccessPolicies))
sfc-gh-asawicki marked this conversation as resolved.
Show resolved Hide resolved
require.LessOrEqual(t, 2, len(returnedRowAccessPolicies))
assert.Contains(t, returnedRowAccessPolicies, *rowAccessPolicy1)
assert.Contains(t, returnedRowAccessPolicies, *rowAccessPolicy2)
})
Expand Down
Loading