This repository was archived by the owner on Apr 11, 2024. It is now read-only.
File tree 2 files changed +6
-4
lines changed
generic/mutation/httpproxy
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -22,12 +22,12 @@ func TestRegionPatch(t *testing.T) {
22
22
23
23
var _ = Describe ("Generate AWS Region patches" , func () {
24
24
// only add aws region patch
25
- regionPatchGenerator := func () mutation.GeneratePatches {
25
+ patchGenerator := func () mutation.GeneratePatches {
26
26
return mutation .NewMetaGeneratePatchesHandler ("" , NewPatch ()).(mutation.GeneratePatches )
27
27
}
28
28
regiontests .TestGeneratePatches (
29
29
GinkgoT (),
30
- regionPatchGenerator ,
30
+ patchGenerator ,
31
31
clusterconfig .MetaVariableName ,
32
32
v1alpha1 .AWSVariableName ,
33
33
VariableName ,
Original file line number Diff line number Diff line change @@ -193,15 +193,17 @@ func TestHTTPProxyPatch(t *testing.T) {
193
193
194
194
var _ = Describe ("Generate HTTPProxy Patches" , func () {
195
195
// only add HTTPProxy patch
196
- httpProxyPatchGenerator := func () mutation.GeneratePatches {
196
+ patchGenerator := func () mutation.GeneratePatches {
197
+ // Always initialize the testEnv variable in the closure.
198
+ // This will allow ginkgo to initialize testEnv variable during test execution time.
197
199
testEnv := helpers .TestEnv
198
200
return mutation .NewMetaGeneratePatchesHandler (
199
201
"" ,
200
202
NewPatch (testEnv .Client )).(mutation.GeneratePatches )
201
203
}
202
204
httpproxy .TestGeneratePatches (
203
205
GinkgoT (),
204
- httpProxyPatchGenerator ,
206
+ patchGenerator ,
205
207
clusterconfig .MetaVariableName ,
206
208
VariableName ,
207
209
)
You can’t perform that action at this time.
0 commit comments