Skip to content

Commit

Permalink
Fix integration test.
Browse files Browse the repository at this point in the history
Signed-off-by: Jim Fitzpatrick <[email protected]>
  • Loading branch information
Boomatang committed Sep 20, 2024
1 parent 0cfa3b4 commit df27d5a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion controllers/state_of_the_world.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (

var (
ConfigMapGroupKind = schema.GroupKind{Group: corev1.GroupName, Kind: "ConfigMap"}
operatorNamespace = env.GetString("OPERATOR_NAMESPACE", "")
operatorNamespace = env.GetString("OPERATOR_NAMESPACE", "kuadrant-system")
)

//+kubebuilder:rbac:groups=gateway.networking.k8s.io,resources=gatewayclasses,verbs=list;watch
Expand Down
8 changes: 7 additions & 1 deletion controllers/test_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
istiosecurityv1beta1 "istio.io/client-go/pkg/apis/security/v1beta1"
istioapis "istio.io/istio/operator/pkg/apis"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"
istiov1alpha1 "maistra.io/istio-operator/api/v1alpha1"
Expand Down Expand Up @@ -256,9 +257,14 @@ func SetupKuadrantOperatorForTest(s *runtime.Scheme, cfg *rest.Config) {

Expect(err).NotTo(HaveOccurred())

dClient, err := dynamic.NewForConfig(mgr.GetConfig())
Expect(err).NotTo(HaveOccurred())

stateOfTheWorld := NewPolicyMachineryController(mgr, dClient, log.Log)

go func() {
defer GinkgoRecover()
err = mgr.Start(ctrl.SetupSignalHandler())
err = stateOfTheWorld.Start(ctrl.SetupSignalHandler())
Expect(err).ToNot(HaveOccurred())
}()
}
Expand Down
6 changes: 3 additions & 3 deletions make/integration-tests.mk
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ test-gatewayapi-env-integration: clean-cov generate fmt vet ginkgo ## Requires k
test-istio-env-integration: clean-cov generate fmt vet ginkgo ## Requires kubernetes cluster with GatewayAPI and Istio installed.
mkdir -p $(PROJECT_PATH)/coverage/istio-integration
# Check `ginkgo help run` for command line options. For example to filtering tests.
GATEWAYAPI_PROVIDER=istio $(GINKGO) \
GATEWAYAPI_PROVIDER=istio OPERATOR_NAMESPACE=kuadrant-system $(GINKGO) \
--coverpkg $(INTEGRATION_COVER_PKGS) \
--output-dir $(PROJECT_PATH)/coverage/istio-integration \
--coverprofile cover.out \
Expand All @@ -62,7 +62,7 @@ test-istio-env-integration: clean-cov generate fmt vet ginkgo ## Requires kubern
test-envoygateway-env-integration: clean-cov generate fmt vet ginkgo ## Requires kubernetes cluster with GatewayAPI and EnvoyGateway installed.
mkdir -p $(PROJECT_PATH)/coverage/envoygateway-integration
# Check `ginkgo help run` for command line options. For example to filtering tests.
GATEWAYAPI_PROVIDER=envoygateway $(GINKGO) \
GATEWAYAPI_PROVIDER=envoygateway OPERATOR_NAMESPACE=kuadrant-system $(GINKGO) \
--coverpkg $(INTEGRATION_COVER_PKGS) \
--output-dir $(PROJECT_PATH)/coverage/envoygateway-integration \
--coverprofile cover.out \
Expand All @@ -80,7 +80,7 @@ test-envoygateway-env-integration: clean-cov generate fmt vet ginkgo ## Requires
test-integration: clean-cov generate fmt vet ginkgo ## Requires kubernetes cluster with at least one GatewayAPI provider installed.
mkdir -p $(PROJECT_PATH)/coverage/integration
# Check `ginkgo help run` for command line options. For example to filtering tests.
GATEWAYAPI_PROVIDER=$(GATEWAYAPI_PROVIDER) $(GINKGO) \
GATEWAYAPI_PROVIDER=$(GATEWAYAPI_PROVIDER) OPERATOR_NAMESPACE=kuadrant-system $(GINKGO) \
--coverpkg $(INTEGRATION_COVER_PKGS) \
--output-dir $(PROJECT_PATH)/coverage/integration \
--coverprofile cover.out \
Expand Down

0 comments on commit df27d5a

Please sign in to comment.