Skip to content

Commit de0cd09

Browse files
committed
fix: r
Signed-off-by: ashing <[email protected]>
1 parent c67d0c2 commit de0cd09

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

test/conformance/suite_test.go

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,8 @@ type GatewayProxyOpts struct {
5757

5858
var defaultGatewayProxyOpts GatewayProxyOpts
5959

60-
func TestMain(m *testing.M) {
61-
RegisterFailHandler(Fail)
62-
f := framework.NewFramework()
63-
64-
f.BeforeSuite()
65-
66-
// Check and delete specific namespaces if they exist
67-
kubectl := k8s.NewKubectlOptions("", "", "default")
60+
func deleteNamespace(kubectl *k8s.KubectlOptions) {
61+
// gateway api conformance test namespaces
6862
namespacesToDelete := []string{
6963
"gateway-conformance-infra",
7064
"gateway-conformance-web-backend",
@@ -105,6 +99,17 @@ func TestMain(m *testing.M) {
10599
GinkgoT().Logf("Namespace %s does not exist or cannot be accessed", ns)
106100
}
107101
}
102+
}
103+
104+
func TestMain(m *testing.M) {
105+
RegisterFailHandler(Fail)
106+
f := framework.NewFramework()
107+
108+
f.BeforeSuite()
109+
110+
// Check and delete specific namespaces if they exist
111+
kubectl := k8s.NewKubectlOptions("", "", "default")
112+
deleteNamespace(kubectl)
108113

109114
namespace := "api7ee-conformance-test"
110115

@@ -173,14 +178,14 @@ func patchGatewaysForConformanceTest(ctx context.Context, k8sClient client.Clien
173178
patched := false
174179
for i := range gatewayList.Items {
175180
gateway := &gatewayList.Items[i]
176-
GinkgoT().Logf("Patching Gateway %s", gateway.Name)
177181

178182
// check if the gateway already has infrastructure.parametersRef
179183
if gateway.Spec.Infrastructure != nil &&
180184
gateway.Spec.Infrastructure.ParametersRef != nil {
181185
continue
182186
}
183187

188+
GinkgoT().Logf("Patching Gateway %s", gateway.Name)
184189
// check if the gateway proxy has been created, if not, create it
185190
if !gatewayProxyMap[gateway.Namespace] {
186191
gatewayProxy := fmt.Sprintf(gatewayProxyYaml,

0 commit comments

Comments
 (0)