Skip to content

Commit 3f5a37c

Browse files
committed
integration test stability improvements
1 parent a73776c commit 3f5a37c

File tree

5 files changed

+462
-375
lines changed

5 files changed

+462
-375
lines changed

Diff for: Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ test: manifests generate fmt vet envtest image-build ## Run tests.
124124
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -race -coverprofile cover.out
125125

126126
.PHONY: test-integration
127-
test-integration: manifests generate fmt vet envtest ## Run tests.
127+
test-integration: ## Run tests.
128128
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./test/integration/epp/... -race -coverprofile cover.out
129129

130130
.PHONY: test-e2e

Diff for: pkg/epp/server/controller_manager.go

+10
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
ctrl "sigs.k8s.io/controller-runtime"
2929
"sigs.k8s.io/controller-runtime/pkg/cache"
3030
"sigs.k8s.io/controller-runtime/pkg/client"
31+
"sigs.k8s.io/controller-runtime/pkg/manager"
3132
"sigs.k8s.io/gateway-api-inference-extension/api/v1alpha2"
3233
)
3334

@@ -76,3 +77,12 @@ func NewDefaultManager(namespace, name string, restConfig *rest.Config) (ctrl.Ma
7677
}
7778
return manager, nil
7879
}
80+
81+
// NewManagerWithOptions creates a new controller manager with injectable options.
82+
func NewManagerWithOptions(restConfig *rest.Config, opts manager.Options) (ctrl.Manager, error) {
83+
manager, err := ctrl.NewManager(restConfig, opts)
84+
if err != nil {
85+
return nil, fmt.Errorf("failed to create controller manager: %v", err)
86+
}
87+
return manager, nil
88+
}

0 commit comments

Comments
 (0)