Skip to content

Commit

Permalink
chore: fix broken TestValidatePermissions unit test (argoproj#8147)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Matyushentsev <[email protected]>
  • Loading branch information
Alexander Matyushentsev authored Jan 11, 2022
1 parent dfd40ef commit 5d770d6
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions util/argo/argo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -604,14 +604,7 @@ func TestValidatePermissions(t *testing.T) {
},
}
db := &dbmocks.ArgoDB{}
db.On("ListClusters", context.Background()).Return(&argoappv1.ClusterList{
Items: []argoappv1.Cluster{
{
Name: "dind",
Server: "https://127.0.0.1:6443",
},
},
}, nil)
db.On("GetClusterServersByName", context.Background(), "does-not-exist").Return(nil, nil)
conditions, err := ValidatePermissions(context.Background(), &spec, &proj, db)
assert.NoError(t, err)
assert.Len(t, conditions, 1)
Expand Down Expand Up @@ -677,9 +670,7 @@ func TestValidatePermissions(t *testing.T) {
Name: "does-exist",
Server: "https://127.0.0.1:6443",
}
db.On("ListClusters", context.Background()).Return(&argoappv1.ClusterList{
Items: []argoappv1.Cluster{cluster},
}, nil)
db.On("GetClusterServersByName", context.Background(), "does-exist").Return([]string{"https://127.0.0.1:6443"}, nil)
db.On("GetCluster", context.Background(), "https://127.0.0.1:6443").Return(&cluster, nil)
conditions, err := ValidatePermissions(context.Background(), &spec, &proj, db)
assert.NoError(t, err)
Expand Down

0 comments on commit 5d770d6

Please sign in to comment.