Skip to content

Commit

Permalink
Merge pull request #87 from atlanhq/APP-5187
Browse files Browse the repository at this point in the history
APP-5187 : Add a check for creating or using an existing user
  • Loading branch information
0xquark authored Feb 4, 2025
2 parents 141bcd4 + 509fa7c commit ea0eba2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion atlan/assets/group_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,12 @@ func testRetrieveGroupByName(t *testing.T) {
func testAddUsersToGroup(t *testing.T, groupID string) {
client := &GroupClient{}

user, err := client.UserClient.GetByEmail(UserEmail, 1, 0)
// This is a dependency issue on user-client test (which creates the user). This test runs before the user-client test
// which creates an issue if the user doesn't exist. So, we add a check here.
// Checks if the test user exists or not and creates it if it doesn't
testUser := getOrCreateTestUser(t)
// Directly uses the Email from the created / existing user
user, err := client.UserClient.GetByEmail(testUser.Email, 1, 0)
require.NoError(t, err, "error should be nil while getting user by email")
err = client.UserClient.AddUserToGroups(user[0].ID, []string{groupID})
require.NoError(t, err, "error should be nil while adding user to group")
Expand Down

0 comments on commit ea0eba2

Please sign in to comment.