Skip to content

Commit

Permalink
tests: run GatewayWithAttachedRoutes from Gateway API conformance sui…
Browse files Browse the repository at this point in the history
…te (#286)
  • Loading branch information
pmalek committed May 23, 2024
1 parent e8c2778 commit 129ee4e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
20 changes: 15 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ SHELL = bash
IMG ?= docker.io/kong/gateway-operator-oss
KUSTOMIZE_IMG_NAME = docker.io/kong/gateway-operator-oss

ifeq (Darwin,$(shell uname -s))
LDFLAGS_COMMON ?= -extldflags=-Wl,-ld_classic
endif

LDFLAGS_METADATA ?= \
-X $(REPO)/modules/manager/metadata.Release=$(TAG) \
-X $(REPO)/modules/manager/metadata.Commit=$(COMMIT) \
-X $(REPO)/modules/manager/metadata.Repo=$(REPO_INFO)

# ------------------------------------------------------------------------------
# Configuration - Tooling
# ------------------------------------------------------------------------------
Expand Down Expand Up @@ -142,10 +151,8 @@ build.operator.debug:

.PHONY: _build.operator
_build.operator:
go build -o bin/manager $(GCFLAGS) -ldflags "$(LDFLAGS) \
-X $(REPO)/modules/manager/metadata.Release=$(TAG) \
-X $(REPO)/modules/manager/metadata.Commit=$(COMMIT) \
-X $(REPO)/modules/manager/metadata.Repo=$(REPO_INFO)" \
go build -o bin/manager $(GCFLAGS) \
-ldflags "$(LDFLAGS_COMMON) $(LDFLAGS) $(LDFLAGS_METADATA)" \
cmd/main.go

.PHONY: build
Expand Down Expand Up @@ -315,6 +322,7 @@ _test.integration: webhook-certs-dir gotestsum
GOTESTSUM_FORMAT=$(GOTESTSUM_FORMAT) \
$(GOTESTSUM) -- $(GOTESTFLAGS) \
-timeout $(INTEGRATION_TEST_TIMEOUT) \
-ldflags "$(LDFLAGS_COMMON) $(LDFLAGS) $(LDFLAGS_METADATA)" \
-race \
-coverprofile=$(COVERPROFILE) \
./test/integration/...
Expand Down Expand Up @@ -343,6 +351,7 @@ test.integration_provision_dataplane_fail:
_test.e2e: gotestsum
GOTESTSUM_FORMAT=$(GOTESTSUM_FORMAT) \
$(GOTESTSUM) -- $(GOTESTFLAGS) \
-ldflags "$(LDFLAGS_COMMON) $(LDFLAGS) $(LDFLAGS_METADATA)" \
-race \
./test/e2e/...

Expand All @@ -359,6 +368,7 @@ _test.conformance: gotestsum
GOTESTSUM_FORMAT=$(GOTESTSUM_FORMAT) \
$(GOTESTSUM) -- $(GOTESTFLAGS) \
-timeout $(CONFORMANCE_TEST_TIMEOUT) \
-ldflags "$(LDFLAGS_COMMON) $(LDFLAGS) $(LDFLAGS_METADATA)" \
-race \
-parallel $(PARALLEL) \
./test/conformance/...
Expand All @@ -368,7 +378,7 @@ test.conformance:
@$(MAKE) _test.conformance \
KGO_PROJECT_URL=$(REPO) \
KGO_PROJECT_NAME=$(REPO_NAME) \
KGO_RELEASE=$(TAG)
KGO_RELEASE=$(TAG) \
GOTESTFLAGS="$(GOTESTFLAGS)"

.PHONY: test.samples
Expand Down
6 changes: 6 additions & 0 deletions controller/gateway/controller_reconciler_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,12 @@ func (g *gatewayConditionsAndListenersAwareT) setProgrammed() {
LastTransitionTime: metav1.Now(),
}
listenerStatus := listenerConditionsAware(listener)
rCond, ok := k8sutils.GetCondition(k8sutils.ConditionType(gatewayv1.ListenerConditionResolvedRefs), listenerStatus)
if ok && rCond.Status == metav1.ConditionFalse {
programmedCondition.Status = metav1.ConditionFalse
programmedCondition.Reason = string(gatewayv1.ListenerReasonPending)
programmedCondition.Message = "Listener references are not resolved yet."
}
k8sutils.SetCondition(programmedCondition, listenerStatus)
}
}
Expand Down
2 changes: 0 additions & 2 deletions test/conformance/conformance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ var skippedTests = []string{
// gateway
tests.GatewayInvalidTLSConfiguration.ShortName,
tests.GatewayModifyListeners.ShortName,
// TODO: https://github.com/Kong/gateway-operator/issues/56
tests.GatewayWithAttachedRoutes.ShortName,

// httproute
tests.HTTPRouteHeaderMatching.ShortName,
Expand Down

0 comments on commit 129ee4e

Please sign in to comment.