Skip to content

Commit

Permalink
fix: lint (#9444)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Crenshaw <[email protected]>
  • Loading branch information
crenshaw-dev authored and alexmt committed May 24, 2022
1 parent 2826a92 commit cd09863
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -594,14 +594,15 @@ func TestAuthenticate_3rd_party_JWTs(t *testing.T) {
},
}

ctx := context.Background()

for _, testData := range tests {
testDataCopy := testData

t.Run(testDataCopy.test, func(t *testing.T) {
t.Parallel()

argocd, dexURL := getTestServer(t, testDataCopy.anonymousEnabled, true)
ctx := context.Background()
testDataCopy.claims.Issuer = fmt.Sprintf("%s/api/dex", dexURL)
token := jwt.NewWithClaims(jwt.SigningMethodHS256, testDataCopy.claims)
tokenString, err := token.SignedString([]byte("key"))
Expand Down Expand Up @@ -689,14 +690,15 @@ func TestAuthenticate_no_SSO(t *testing.T) {
},
}

ctx := context.Background()

for _, testData := range tests {
testDataCopy := testData

t.Run(testDataCopy.test, func(t *testing.T) {
t.Parallel()

argocd, dexURL := getTestServer(t, testDataCopy.anonymousEnabled, false)
ctx := context.Background()
token := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.RegisteredClaims{Issuer: fmt.Sprintf("%s/api/dex", dexURL)})
tokenString, err := token.SignedString([]byte("key"))
require.NoError(t, err)
Expand Down Expand Up @@ -795,14 +797,15 @@ func TestAuthenticate_bad_request_metadata(t *testing.T) {
},
}

ctx := context.Background()

for _, testData := range tests {
testDataCopy := testData

t.Run(testDataCopy.test, func(t *testing.T) {
t.Parallel()

argocd, _ := getTestServer(t, testDataCopy.anonymousEnabled, true)
ctx := context.Background()
ctx = metadata.NewIncomingContext(context.Background(), testDataCopy.metadata)

ctx, err := argocd.Authenticate(ctx)
Expand Down

0 comments on commit cd09863

Please sign in to comment.