This repository was archived by the owner on Apr 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
generic/mutation/httpproxy Expand file tree Collapse file tree 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) {
2222
2323var _ = Describe ("Generate AWS Region patches" , func () {
2424 // only add aws region patch
25- regionPatchGenerator := func () mutation.GeneratePatches {
25+ patchGenerator := func () mutation.GeneratePatches {
2626 return mutation .NewMetaGeneratePatchesHandler ("" , NewPatch ()).(mutation.GeneratePatches )
2727 }
2828 regiontests .TestGeneratePatches (
2929 GinkgoT (),
30- regionPatchGenerator ,
30+ patchGenerator ,
3131 clusterconfig .MetaVariableName ,
3232 v1alpha1 .AWSVariableName ,
3333 VariableName ,
Original file line number Diff line number Diff line change @@ -193,15 +193,17 @@ func TestHTTPProxyPatch(t *testing.T) {
193193
194194var _ = Describe ("Generate HTTPProxy Patches" , func () {
195195 // 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.
197199 testEnv := helpers .TestEnv
198200 return mutation .NewMetaGeneratePatchesHandler (
199201 "" ,
200202 NewPatch (testEnv .Client )).(mutation.GeneratePatches )
201203 }
202204 httpproxy .TestGeneratePatches (
203205 GinkgoT (),
204- httpProxyPatchGenerator ,
206+ patchGenerator ,
205207 clusterconfig .MetaVariableName ,
206208 VariableName ,
207209 )
You can’t perform that action at this time.
0 commit comments