Skip to content

Commit

Permalink
chore(grants): cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dkanney committed Feb 12, 2025
1 parent e8bc074 commit 892fb32
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 45 deletions.
30 changes: 3 additions & 27 deletions internal/iam/repository_role_grant_ext_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,6 @@ func TestGrantsForUser_DirectAssociation(t *testing.T) {
_, err := repo.GrantsForUser(ctx, userId, iam.WithTestCacheMultiGrantTuples(multiGrantTuplesCache))
require.NoError(t, err)

// log.Println("multiGrantTuplesCache", pretty.Sprint(*multiGrantTuplesCache))
assert.ElementsMatch(t, *multiGrantTuplesCache, expMultiGrantTuples[userId])
}
})
Expand Down Expand Up @@ -1038,14 +1037,7 @@ func TestGrantsForUser_DirectAssociation(t *testing.T) {
},
},
}
/*
log.Println("org1", directGrantOrg1.PublicId)
log.Println("proj1a", directGrantProj1a.PublicId)
log.Println("proj1b", directGrantProj1b.PublicId)
log.Println("org2", directGrantOrg2.PublicId)
log.Println("proj2a", directGrantProj2a.PublicId)
log.Println("proj2b", directGrantProj2b.PublicId)
*/

assert.Len(t, directGrants, len(expDirectGrants))
for k, v := range directGrants {
assert.ElementsMatch(t, v, expDirectGrants[k])
Expand Down Expand Up @@ -1395,7 +1387,6 @@ func TestGrantsForUser_Group(t *testing.T) {
_, err := repo.GrantsForUser(ctx, userId, iam.WithTestCacheMultiGrantTuples(multiGrantTuplesCache))
require.NoError(t, err)

// log.Println("multiGrantTuplesCache", pretty.Sprint(*multiGrantTuplesCache))
assert.ElementsMatch(t, *multiGrantTuplesCache, expMultiGrantTuples[userId])
}
})
Expand Down Expand Up @@ -1709,14 +1700,7 @@ func TestGrantsForUser_Group(t *testing.T) {
},
},
}
/*
log.Println("org1", directGrantOrg1.PublicId)
log.Println("proj1a", directGrantProj1a.PublicId)
log.Println("proj1b", directGrantProj1b.PublicId)
log.Println("org2", directGrantOrg2.PublicId)
log.Println("proj2a", directGrantProj2a.PublicId)
log.Println("proj2b", directGrantProj2b.PublicId)
*/

assert.Len(t, directGrants, len(expDirectGrants))
for k, v := range directGrants {
assert.ElementsMatch(t, v, expDirectGrants[k])
Expand Down Expand Up @@ -2088,7 +2072,6 @@ func TestGrantsForUser_ManagedGroup(t *testing.T) {
_, err := repo.GrantsForUser(ctx, userId, iam.WithTestCacheMultiGrantTuples(multiGrantTuplesCache))
require.NoError(t, err)

// log.Println("multiGrantTuplesCache", pretty.Sprint(*multiGrantTuplesCache))
assert.ElementsMatch(t, *multiGrantTuplesCache, expMultiGrantTuples[userId])
}
})
Expand Down Expand Up @@ -2402,14 +2385,7 @@ func TestGrantsForUser_ManagedGroup(t *testing.T) {
},
},
}
/*
log.Println("org1", directGrantOrg1.PublicId)
log.Println("proj1a", directGrantProj1a.PublicId)
log.Println("proj1b", directGrantProj1b.PublicId)
log.Println("org2", directGrantOrg2.PublicId)
log.Println("proj2a", directGrantProj2a.PublicId)
log.Println("proj2b", directGrantProj2b.PublicId)
*/

assert.Len(t, directGrants, len(expDirectGrants))
for k, v := range directGrants {
assert.ElementsMatch(t, v, expDirectGrants[k])
Expand Down
20 changes: 2 additions & 18 deletions internal/iam/repository_role_grant_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,6 @@ func TestGrantsForUser(t *testing.T) {
_, err := repo.GrantsForUser(ctx, user.PublicId, WithTestCacheMultiGrantTuples(multiGrantTuplesCache))
require.NoError(t, err)

// log.Println("multiGrantTuplesCache", pretty.Sprint(*multiGrantTuplesCache))
assert.ElementsMatch(t, *multiGrantTuplesCache, expMultiGrantTuples)
})

Expand Down Expand Up @@ -1070,14 +1069,7 @@ func TestGrantsForUser(t *testing.T) {
},
},
}
/*
log.Println("org1", directGrantOrg1.PublicId)
log.Println("proj1a", directGrantProj1a.PublicId)
log.Println("proj1b", directGrantProj1b.PublicId)
log.Println("org2", directGrantOrg2.PublicId)
log.Println("proj2a", directGrantProj2a.PublicId)
log.Println("proj2b", directGrantProj2b.PublicId)
*/

assert.Len(t, directGrants, len(expDirectGrants))
for k, v := range directGrants {
assert.ElementsMatch(t, v, expDirectGrants[k])
Expand Down Expand Up @@ -1671,7 +1663,6 @@ func TestGrantsForUser_Group(t *testing.T) {
_, err := repo.GrantsForUser(ctx, user.PublicId, WithTestCacheMultiGrantTuples(multiGrantTuplesCache))
require.NoError(t, err)

// log.Println("multiGrantTuplesCache", pretty.Sprint(*multiGrantTuplesCache))
assert.ElementsMatch(t, *multiGrantTuplesCache, expMultiGrantTuples)
})

Expand Down Expand Up @@ -1984,14 +1975,7 @@ func TestGrantsForUser_Group(t *testing.T) {
},
},
}
/*
log.Println("org1", directGrantOrg1.PublicId)
log.Println("proj1a", directGrantProj1a.PublicId)
log.Println("proj1b", directGrantProj1b.PublicId)
log.Println("org2", directGrantOrg2.PublicId)
log.Println("proj2a", directGrantProj2a.PublicId)
log.Println("proj2b", directGrantProj2b.PublicId)
*/

assert.Len(t, directGrants, len(expDirectGrants))
for k, v := range directGrants {
assert.ElementsMatch(t, v, expDirectGrants[k])
Expand Down

0 comments on commit 892fb32

Please sign in to comment.