mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2026-09-20 15:04:34 +00:00
Enable 'copyloopvar' linter
This commit is contained in:
-3
@@ -71,7 +71,6 @@ func TestActiveDirectoryUpstreamWatcherControllerFilterSecrets(t *testing.T) {
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
test := test
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -116,7 +115,6 @@ func TestActiveDirectoryUpstreamWatcherControllerFilterActiveDirectoryIdentityPr
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
test := test
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -2002,7 +2000,6 @@ func TestActiveDirectoryUpstreamWatcherControllerSync(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
tt := tt
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
||||
@@ -85,7 +85,6 @@ func TestFederationDomainWatcherControllerInformerFilters(t *testing.T) {
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
test := test
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -1999,7 +1998,6 @@ func TestTestFederationDomainWatcherControllerSync(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
tt := tt
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
||||
@@ -168,7 +168,6 @@ func TestFederationDomainControllerFilterSecret(t *testing.T) {
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
test := test
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -231,7 +230,6 @@ func TestNewFederationDomainSecretsControllerFilterFederationDomain(t *testing.T
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
test := test
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -264,11 +262,11 @@ func TestNewFederationDomainSecretsControllerFilterFederationDomain(t *testing.T
|
||||
|
||||
unrelated := configv1alpha1.FederationDomain{}
|
||||
filter := withInformer.GetFilterForInformer(federationDomainInformer)
|
||||
require.Equal(t, test.wantAdd, filter.Add(&test.federationDomain))
|
||||
require.Equal(t, test.wantUpdate, filter.Update(&unrelated, &test.federationDomain))
|
||||
require.Equal(t, test.wantUpdate, filter.Update(&test.federationDomain, &unrelated))
|
||||
require.Equal(t, test.wantDelete, filter.Delete(&test.federationDomain))
|
||||
require.Equal(t, test.wantParent, filter.Parent(&test.federationDomain))
|
||||
require.Equal(t, test.wantAdd, filter.Add(test.federationDomain.DeepCopy()))
|
||||
require.Equal(t, test.wantUpdate, filter.Update(&unrelated, test.federationDomain.DeepCopy()))
|
||||
require.Equal(t, test.wantUpdate, filter.Update(test.federationDomain.DeepCopy(), &unrelated))
|
||||
require.Equal(t, test.wantDelete, filter.Delete(test.federationDomain.DeepCopy()))
|
||||
require.Equal(t, test.wantParent, filter.Parent(test.federationDomain.DeepCopy()))
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -625,7 +623,6 @@ func TestFederationDomainSecretsControllerSync(t *testing.T) {
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
test := test
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2020-2021 the Pinniped contributors. All Rights Reserved.
|
||||
// Copyright 2020-2024 the Pinniped contributors. All Rights Reserved.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package generator
|
||||
@@ -52,7 +52,6 @@ func TestSymmetricSecretHelper(t *testing.T) {
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
test := test
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -182,7 +181,6 @@ func TestSymmetricSecretHelperIsValid(t *testing.T) {
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
test := test
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
h := NewSymmetricSecretHelper("none of these args matter", nil, nil, test.secretUsage, nil)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2020-2023 the Pinniped contributors. All Rights Reserved.
|
||||
// Copyright 2020-2024 the Pinniped contributors. All Rights Reserved.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package generator
|
||||
@@ -100,7 +100,6 @@ func TestSupervisorSecretsControllerFilterSecret(t *testing.T) {
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
test := test
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -407,7 +406,6 @@ func TestSupervisorSecretsControllerSync(t *testing.T) {
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
test := test
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
// We cannot currently run this test in parallel since it uses the global generateKey function.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2020-2023 the Pinniped contributors. All Rights Reserved.
|
||||
// Copyright 2020-2024 the Pinniped contributors. All Rights Reserved.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package supervisorconfig
|
||||
@@ -167,7 +167,6 @@ func TestJWKSWriterControllerFilterSecret(t *testing.T) {
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
test := test
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -221,7 +220,6 @@ func TestJWKSWriterControllerFilterFederationDomain(t *testing.T) {
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
test := test
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -245,11 +243,11 @@ func TestJWKSWriterControllerFilterFederationDomain(t *testing.T) {
|
||||
|
||||
unrelated := configv1alpha1.FederationDomain{}
|
||||
filter := withInformer.GetFilterForInformer(federationDomainInformer)
|
||||
require.Equal(t, test.wantAdd, filter.Add(&test.federationDomain))
|
||||
require.Equal(t, test.wantUpdate, filter.Update(&unrelated, &test.federationDomain))
|
||||
require.Equal(t, test.wantUpdate, filter.Update(&test.federationDomain, &unrelated))
|
||||
require.Equal(t, test.wantDelete, filter.Delete(&test.federationDomain))
|
||||
require.Equal(t, test.wantParent, filter.Parent(&test.federationDomain))
|
||||
require.Equal(t, test.wantAdd, filter.Add(test.federationDomain.DeepCopy()))
|
||||
require.Equal(t, test.wantUpdate, filter.Update(&unrelated, test.federationDomain.DeepCopy()))
|
||||
require.Equal(t, test.wantUpdate, filter.Update(test.federationDomain.DeepCopy(), &unrelated))
|
||||
require.Equal(t, test.wantDelete, filter.Delete(test.federationDomain.DeepCopy()))
|
||||
require.Equal(t, test.wantParent, filter.Parent(test.federationDomain.DeepCopy()))
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -664,7 +662,6 @@ func TestJWKSWriterControllerSync(t *testing.T) {
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
test := test
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
// We shouldn't run this test in parallel since it messes with a global function (generateKey).
|
||||
generateKeyCount := 0
|
||||
|
||||
@@ -70,7 +70,6 @@ func TestLDAPUpstreamWatcherControllerFilterSecrets(t *testing.T) {
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
test := test
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -115,7 +114,6 @@ func TestLDAPUpstreamWatcherControllerFilterLDAPIdentityProviders(t *testing.T)
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
test := test
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -1131,7 +1129,6 @@ func TestLDAPUpstreamWatcherControllerSync(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
tt := tt
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2022-2023 the Pinniped contributors. All Rights Reserved.
|
||||
// Copyright 2022-2024 the Pinniped contributors. All Rights Reserved.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package oidcclientwatcher
|
||||
@@ -954,7 +954,6 @@ func TestOIDCClientWatcherControllerSync(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
tt := tt
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
fakePinnipedClient := pinnipedfake.NewSimpleClientset(tt.inputObjects...)
|
||||
|
||||
@@ -74,7 +74,6 @@ func TestOIDCUpstreamWatcherControllerFilterSecret(t *testing.T) {
|
||||
},
|
||||
}
|
||||
for _, test := range tests {
|
||||
test := test
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
@@ -1409,7 +1408,6 @@ oidc: issuer did not match the issuer returned by provider, expected "` + testIs
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
tt := tt
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
fakePinnipedClient := pinnipedfake.NewSimpleClientset(tt.inputUpstreams...)
|
||||
|
||||
Reference in New Issue
Block a user