authinfoimpl: Fix TestIntegrationAuthInfoStore when running on Spanner. (#103383)

Fix TestIntegrationAuthInfoStore when running on Spanner.
pull/103443/head
Peter Štibraný 2 months ago committed by GitHub
parent a0bce1e12f
commit b1198b92c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      pkg/services/login/authinfoimpl/store_test.go

@ -50,7 +50,10 @@ func TestIntegrationAuthInfoStore(t *testing.T) {
require.NoError(t, err)
require.Len(t, labels, 2)
require.Equal(t, login.AzureADAuthModule, labels[1])
// There is no guarantee that user with user_id=1 gets "oauth_azuread" or "ldap".
// Both are valid results for the query (basically SELECT * FROM `user_auth` WHERE `user_id` IN (1,2) ORDER BY created),
// Spanner emulator will randomize its output, so test cannot rely on the ordering (other than "Created" column, which is equal here).
require.True(t, labels[1] == login.AzureADAuthModule || labels[1] == login.LDAPAuthModule)
require.Equal(t, login.GoogleAuthModule, labels[2])
})

Loading…
Cancel
Save