Skip to content

Commit 02ebcfe

Browse files
committed
update makefile
1 parent d58e9f0 commit 02ebcfe

File tree

3 files changed

+31
-22
lines changed

3 files changed

+31
-22
lines changed

internal/mode/static/state/graph/route_common_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,6 +1793,7 @@ func TestAllowedRouteType(t *testing.T) {
17931793
})
17941794
}
17951795
}
1796+
17961797
func TestBindL4RouteToListeners(t *testing.T) {
17971798
// we create a new listener each time because the function under test can modify it
17981799
createListener := func(name string) *Listener {

tests/Makefile

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,23 @@ GW_SVC_GKE_INTERNAL = false
1212
NGF_VERSION ?= $(shell git describe --tags $(shell git rev-list --tags --max-count=1))## NGF version to be tested (defaults to latest tag)
1313
PULL_POLICY = Never## Pull policy for the images
1414
PROVISIONER_MANIFEST = conformance/provisioner/provisioner.yaml
15-
SUPPORTED_FEATURES = HTTPRouteQueryParamMatching,HTTPRouteMethodMatching,HTTPRoutePortRedirect,HTTPRouteSchemeRedirect,HTTPRouteHostRewrite,HTTPRoutePathRewrite,GatewayPort8080,HTTPRouteResponseHeaderModification,GRPCExactMethodMatching,GRPCRouteListenerHostnameMatching,GRPCRouteHeaderMatching,TLSRoute
15+
SUPPORTED_EXTENDED_FEATURES = HTTPRouteQueryParamMatching,HTTPRouteMethodMatching,HTTPRoutePortRedirect,HTTPRouteSchemeRedirect,HTTPRouteHostRewrite,HTTPRoutePathRewrite,GatewayPort8080,HTTPRouteResponseHeaderModification
16+
STANDARD_CONFORMANCE_PROFILES = GATEWAY-HTTP,GATEWAY-GRPC
17+
EXPERIMENTAL_CONFORMANCE_PROFILES = GATEWAY-TLS
18+
CONFORMANCE_PROFILES = $(STANDARD_CONFORMANCE_PROFILES) # by default we use the standard conformance profiles. If experimental is enabled we override this and add the experimental profiles.
19+
SKIP_TESTS = TLSRouteInvalidReferenceGrant
1620

1721
ifneq ($(GINKGO_LABEL),)
1822
override GINKGO_FLAGS += --label-filter "$(GINKGO_LABEL)"
1923
endif
2024

25+
# Check if ENABLE_EXPERIMENTAL is true
26+
ifeq ($(ENABLE_EXPERIMENTAL),true)
27+
# If true, add the experimental conformance profiles
28+
CONFORMANCE_PROFILES = $(EXPERIMENTAL_CONFORMANCE_PROFILES),$(STANDARD_CONFORMANCE_PROFILES)
29+
endif
30+
31+
2132
.PHONY: update-go-modules
2233
update-go-modules: ## Update the gateway-api go modules to latest main version
2334
go get -u sigs.k8s.io/gateway-api@main
@@ -35,9 +46,9 @@ run-conformance-tests: ## Run conformance tests
3546
--image=$(CONFORMANCE_PREFIX):$(CONFORMANCE_TAG) --image-pull-policy=Never \
3647
--overrides='{ "spec": { "serviceAccountName": "conformance" } }' \
3748
--restart=Never -- sh -c "go test -v . -tags conformance,experimental -args --gateway-class=$(GATEWAY_CLASS) \
38-
--supported-features=$(SUPPORTED_FEATURES) --version=$(NGF_VERSION) --skip-tests=TLSRouteInvalidReferenceGrant \
49+
--supported-features=$(SUPPORTED_EXTENDED_FEATURES) --version=$(NGF_VERSION) --skip-tests=$(SKIP_TESTS) --conformance-profiles=$(CONFORMANCE_PROFILES) \
3950
--report-output=output.txt; cat output.txt" | tee output.txt
40-
./scripts/check-pod-exit-code.sh
51+
bash scripts/check-pod-exit-code.sh
4152
sed -e '1,/CONFORMANCE PROFILE/d' output.txt > conformance-profile.yaml
4253
rm output.txt
4354
grpc_core_result=`yq '.profiles[0].core.result' conformance-profile.yaml`; \
@@ -78,27 +89,27 @@ setup-gcp-and-run-nfr-tests: create-gke-router create-and-setup-vm nfr-test ## C
7889

7990
.PHONY: create-gke-cluster
8091
create-gke-cluster: ## Create a GKE cluster
81-
./scripts/create-gke-cluster.sh $(CI)
92+
bash scripts/create-gke-cluster.sh $(CI)
8293

8394
.PHONY: create-and-setup-vm
8495
create-and-setup-vm: ## Create and setup a GCP VM for tests
85-
./scripts/create-and-setup-gcp-vm.sh
96+
bash scripts/create-and-setup-gcp-vm.sh
8697

8798
.PHONY: create-gke-router
8899
create-gke-router: ## Create a GKE router to allow egress traffic from private nodes (allows for external image pulls)
89-
./scripts/create-gke-router.sh
100+
bash scripts/create-gke-router.sh
90101

91102
.PHONY: sync-files-to-vm
92103
sync-files-to-vm: ## Syncs your local NGF files with the NGF repo on the VM
93-
./scripts/sync-files-to-vm.sh
104+
bash scripts/sync-files-to-vm.sh
94105

95106
.PHONY: run-tests-on-vm
96107
run-tests-on-vm: ## Run the functional tests on a GCP VM
97-
./scripts/run-tests-gcp-vm.sh
108+
bash scripts/run-tests-gcp-vm.sh
98109

99110
.PHONY: nfr-test
100111
nfr-test: ## Run the NFR tests on a GCP VM
101-
NFR=true CI=$(CI) ./scripts/run-tests-gcp-vm.sh
112+
NFR=true CI=$(CI) bash scripts/run-tests-gcp-vm.sh
102113

103114
.PHONY: start-longevity-test
104115
start-longevity-test: export START_LONGEVITY=true
@@ -136,19 +147,19 @@ cleanup-gcp: cleanup-router cleanup-vm delete-gke-cluster ## Cleanup all GCP res
136147

137148
.PHONY: cleanup-router
138149
cleanup-router: ## Delete the GKE router
139-
./scripts/cleanup-router.sh
150+
bash scripts/cleanup-router.sh
140151

141152
.PHONY: cleanup-vm
142153
cleanup-vm: ## Delete the test GCP VM and delete the firewall rule
143-
./scripts/cleanup-vm.sh
154+
bash scripts/cleanup-vm.sh
144155

145156
.PHONY: delete-gke-cluster
146157
delete-gke-cluster: ## Delete the GKE cluster
147-
./scripts/delete-gke-cluster.sh
158+
bash scripts/delete-gke-cluster.sh
148159

149160
.PHONY: add-local-ip-to-cluster
150161
add-local-ip-to-cluster: ## Add local IP to the GKE cluster master-authorized-networks
151-
./scripts/add-local-ip-auth-networks.sh
162+
bash scripts/add-local-ip-auth-networks.sh
152163

153164
HELM_PARAMETERS += --set nameOverride=nginx-gateway --set nginxGateway.kind=skip --set service.create=false
154165

@@ -159,7 +170,7 @@ deploy-updated-provisioner: ## Update provisioner manifest and deploy to the con
159170

160171
.PHONY: generate-static-deployment
161172
generate-static-deployment:
162-
helm template nginx-gateway $(CHART_DIR) --set nameOverride=nginx-gateway --set metrics.enable=false --set nginxGateway.productTelemetry.enable=false -n nginx-gateway -s templates/deployment.yaml --set nginxGateway.image.repository=$(PREFIX) --set nginxGateway.image.tag=$(TAG) --set nginxGateway.image.pullPolicy=Never --set nginx.image.repository=$(NGINX_PREFIX) --set nginx.image.tag=$(TAG) --set nginx.image.pullPolicy=Never --set nginxGateway.gwAPIExperimentalFeatures.enable=$(ENABLE_EXPERIMENTAL) --set nginx.plus=$(PLUS_ENABLED) > $(SELF_DIR)config/tests/static-deployment.yaml
173+
helm template nginx-gateway $(CHART_DIR) $(HELM_TEMPLATE_COMMON_ARGS) --set metrics.enable=false --set nginxGateway.productTelemetry.enable=false -n nginx-gateway -s templates/deployment.yaml --set nginxGateway.image.repository=$(PREFIX) --set nginxGateway.image.tag=$(TAG) --set nginxGateway.image.pullPolicy=Never --set nginx.image.repository=$(NGINX_PREFIX) --set nginx.image.tag=$(TAG) --set nginx.image.pullPolicy=Never --set nginxGateway.gwAPIExperimentalFeatures.enable=$(ENABLE_EXPERIMENTAL) --set nginx.plus=$(PLUS_ENABLED) > $(SELF_DIR)config/tests/static-deployment.yaml
163174

164175
# this target is used to install the gateway-api CRDs from the main branch (only used in the nightly CI job)
165176
# it overrides the target in the main Makefile when the GW_API_VERSION is set to main

tests/conformance/conformance_test.go

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222
"testing"
2323

2424
. "github.com/onsi/gomega"
25-
"k8s.io/apimachinery/pkg/util/sets"
2625
"sigs.k8s.io/gateway-api/conformance"
2726
conf_v1 "sigs.k8s.io/gateway-api/conformance/apis/v1"
2827
"sigs.k8s.io/gateway-api/conformance/tests"
@@ -35,9 +34,12 @@ func TestConformance(t *testing.T) {
3534
g := NewWithT(t)
3635

3736
t.Logf(`Running conformance tests with %s GatewayClass\n cleanup: %t\n`+
38-
`debug: %t\n enable all features: %t \n supported features: [%v]\n exempt features: [%v]`,
37+
`debug: %t\n enable all features: %t \n supported extended features: [%v]\n exempt features: [%v]\n`+
38+
`conformance profiles: [%v]\n skip tests: [%v]`,
3939
*flags.GatewayClassName, *flags.CleanupBaseResources, *flags.ShowDebug,
40-
*flags.EnableAllSupportedFeatures, *flags.SupportedFeatures, *flags.ExemptFeatures)
40+
*flags.EnableAllSupportedFeatures, *flags.SupportedFeatures, *flags.ExemptFeatures,
41+
*flags.ConformanceProfiles, *flags.SkipTests,
42+
)
4143

4244
opts := conformance.DefaultOptions(t)
4345
opts.Implementation = conf_v1.Implementation{
@@ -49,11 +51,6 @@ func TestConformance(t *testing.T) {
4951
"https://github.com/nginxinc/nginx-gateway-fabric/discussions/new/choose",
5052
},
5153
}
52-
opts.ConformanceProfiles = sets.New(
53-
suite.GatewayHTTPConformanceProfileName,
54-
suite.GatewayGRPCConformanceProfileName,
55-
suite.GatewayTLSConformanceProfileName,
56-
)
5754

5855
testSuite, err := suite.NewConformanceTestSuite(opts)
5956
g.Expect(err).To(Not(HaveOccurred()))

0 commit comments

Comments
 (0)