Skip to content

Commit 3b413a0

Browse files
committed
Moves gw api env var to Setup test env step
Signed-off-by: Daneyon Hansen <[email protected]>
1 parent 9dae4d1 commit 3b413a0

File tree

6 files changed

+48
-15
lines changed

6 files changed

+48
-15
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
k8sgateway_api_version='v1.2.0'
1+
k8sgateway_api_version='v1.2.1'

.github/workflows/composite-actions/kube-gateway-api-conformance-tests/action.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ runs:
4040
CLUSTER_NODE_VERSION: ${{ matrix.kube-version.node }}
4141
IMAGE_VARIANT: ${{ matrix.image-variant }}
4242
CONFORMANCE: "true"
43+
CONFORMANCE_VERSION: ${{ inputs.k8sgateway-api-version }}
4344
run: ./ci/kind/setup-kind.sh
4445
- name: Install Gloo Gateway with the k8s gateway integration enabled
4546
shell: bash
@@ -57,9 +58,9 @@ runs:
5758
fi
5859
- name: Run the kubernetes gateway API conformance tests
5960
shell: bash
60-
env:
61-
GATEWAY_API_VERSION: ${{ inputs.k8sgateway-api-version }}
6261
run: make conformance
62+
env:
63+
CONFORMANCE_VERSION: ${{ inputs.k8sgateway-api-version }}
6364
- name: Capture debug information when tests fail
6465
if: ${{ failure() }}
6566
shell: bash

.github/workflows/nightly-tests.yaml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,15 @@ jobs:
489489
- uses: actions/checkout@v4
490490
with:
491491
ref: main
492+
- name: Dotenv Action
493+
uses: falti/[email protected]
494+
id: dotenv
495+
with:
496+
path: ${{ matrix.version-files.file }}
497+
log-variables: true
492498
- uses: ./.github/workflows/composite-actions/kube-gateway-api-conformance-tests
499+
with:
500+
k8sgateway-api-version: ${{ steps.dotenv.outputs.k8sgateway_api_version }}
493501

494502
kube_gateway_api_conformance_tests_18:
495503
name: Conformance (branch=v1.18.x, type=Kubernetes Gateway API, version=${{matrix.kube-version.node}} )
@@ -507,8 +515,15 @@ jobs:
507515
- uses: actions/checkout@v4
508516
with:
509517
ref: v1.18.x
518+
- name: Dotenv Action
519+
uses: falti/[email protected]
520+
id: dotenv
521+
with:
522+
path: ${{ matrix.version-files.file }}
523+
log-variables: true
510524
- uses: ./.github/workflows/composite-actions/kube-gateway-api-conformance-tests
511-
525+
with:
526+
k8sgateway-api-version: ${{ steps.dotenv.outputs.k8sgateway_api_version }}
512527

513528
kube_gateway_api_conformance_tests_17:
514529
name: Conformance (branch=v1.17.x, type=Kubernetes Gateway API, version=${{matrix.kube-version.node}} )

.github/workflows/regression-tests.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,29 @@ jobs:
8282
# (see https://github.com/solo-io/solo-projects/issues/6094)
8383
image-variant:
8484
- standard
85+
version-files:
86+
- label: 'min'
87+
file: './.github/workflows/.env/pr-tests/min_versions.env'
88+
- label: 'max'
89+
file: './.github/workflows/.env/pr-tests/max_versions.env'
8590
steps:
91+
# Checkout the branch that initiated the action
8692
- uses: actions/checkout@v4
8793
- id: auto-succeed-tests
8894
if: needs.prepare_env.outputs.should-auto-succeed-regression-tests == 'true'
8995
run: |
9096
echo "Kubernetes Gateway API conformance tests auto-succeeded"
97+
# The dotenv action is used to load key-value pairs from files.
98+
# In this case, the file is specified in the matrix and will contain the versions of the tools to use
99+
- name: Dotenv Action
100+
uses: falti/[email protected]
101+
id: dotenv
102+
with:
103+
path: ${{ matrix.version-files.file }}
104+
log-variables: true
105+
# Run the k8s gateway api conformance tests
91106
- id: run-tests
92107
if: needs.prepare_env.outputs.should-auto-succeed-regression-tests != 'true'
93108
uses: ./.github/workflows/composite-actions/kube-gateway-api-conformance-tests
109+
with:
110+
k8sgateway-api-version: ${{ steps.dotenv.outputs.k8sgateway_api_version }}

Makefile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ TEST_ASSET_DIR ?= $(ROOTDIR)/_test
9595
# Directory to store downloaded conformance tests for different versions
9696
CONFORMANCE_DIR ?= $(TEST_ASSET_DIR)/conformance
9797
# Gateway API version used for conformance testing
98-
GATEWAY_API_VERSION ?= v1.2.0
98+
CONFORMANCE_VERSION ?= v1.2.0
9999
# Fetch the module directory for the specified version of the Gateway API
100-
GATEWAY_API_MODULE_DIR := $(shell go list -m -json sigs.k8s.io/gateway-api@$(GATEWAY_API_VERSION) | jq -r '.Dir')
100+
GATEWAY_API_MODULE_DIR := $(shell go mod download -json sigs.k8s.io/gateway-api@$(CONFORMANCE_VERSION) | jq -r '.Dir')
101101

102102
# This is the location where assets are placed after a test failure
103103
# This is used by our e2e tests to emit information about the running instance of Gloo Gateway
@@ -1244,14 +1244,14 @@ build-test-chart: ## Build the Helm chart and place it in the _test directory
12441244
#----------------------------------------------------------------------------------
12451245

12461246
# Download and prepare the conformance test suite for a specific Gateway API version
1247-
$(CONFORMANCE_DIR)/$(GATEWAY_API_VERSION)/conformance_test.go:
1248-
mkdir -p $(CONFORMANCE_DIR)/$(GATEWAY_API_VERSION)
1249-
go mod download sigs.k8s.io/gateway-api@$(GATEWAY_API_VERSION)
1247+
$(CONFORMANCE_DIR)/$(CONFORMANCE_VERSION)/conformance_test.go:
1248+
mkdir -p $(CONFORMANCE_DIR)/$(CONFORMANCE_VERSION)
1249+
go mod download sigs.k8s.io/gateway-api@$(CONFORMANCE_VERSION)
12501250
cp $(GATEWAY_API_MODULE_DIR)/conformance/conformance_test.go $@
12511251

12521252
# Install the correct version of Gateway API CRDs in the Kubernetes cluster
12531253
install-crds:
1254-
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/$(GATEWAY_API_VERSION)/experimental-install.yaml
1254+
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/$(CONFORMANCE_VERSION)/experimental-install.yaml
12551255

12561256
# Update go.mod to replace Gateway API module with the version used for conformance testing
12571257
update-mod:
@@ -1265,18 +1265,18 @@ reset-mod:
12651265
# Common arguments for conformance testing
12661266
CONFORMANCE_SUPPORTED_FEATURES ?= -supported-features=Gateway,ReferenceGrant,HTTPRoute,HTTPRouteQueryParamMatching,HTTPRouteMethodMatching,HTTPRouteResponseHeaderModification,HTTPRoutePortRedirect,HTTPRouteHostRewrite,HTTPRouteSchemeRedirect,HTTPRoutePathRedirect,HTTPRouteHostRewrite,HTTPRoutePathRewrite,HTTPRouteRequestMirror
12671267
CONFORMANCE_SUPPORTED_PROFILES ?= -conformance-profiles=GATEWAY-HTTP
1268-
CONFORMANCE_REPORT_ARGS ?= -report-output=$(CONFORMANCE_DIR)/$(GATEWAY_API_VERSION)/$(VERSION)-report.yaml -organization=solo.io -project=gloo-gateway -version=$(VERSION) -url=github.com/solo-io/gloo -contact=github.com/solo-io/gloo/issues/new/choose
1268+
CONFORMANCE_REPORT_ARGS ?= -report-output=$(CONFORMANCE_DIR)/$(CONFORMANCE_VERSION)/$(VERSION)-report.yaml -organization=solo.io -project=gloo-gateway -version=$(VERSION) -url=github.com/solo-io/gloo -contact=github.com/solo-io/gloo/issues/new/choose
12691269
CONFORMANCE_ARGS := -gateway-class=gloo-gateway $(CONFORMANCE_SUPPORTED_FEATURES) $(CONFORMANCE_SUPPORTED_PROFILES) $(CONFORMANCE_REPORT_ARGS)
12701270

12711271
# Run conformance tests for the specified Gateway API version
12721272
.PHONY: conformance
1273-
conformance: $(CONFORMANCE_DIR)/$(GATEWAY_API_VERSION)/conformance_test.go install-crds update-mod
1273+
conformance: $(CONFORMANCE_DIR)/$(CONFORMANCE_VERSION)/conformance_test.go install-crds update-mod
12741274
@trap "make reset-mod" EXIT; \
1275-
go test -mod=mod -ldflags=$(LDFLAGS) -tags conformance -test.v $(CONFORMANCE_DIR)/$(GATEWAY_API_VERSION)/... -args $(CONFORMANCE_ARGS)
1275+
go test -mod=mod -ldflags=$(LDFLAGS) -tags conformance -test.v $(CONFORMANCE_DIR)/$(CONFORMANCE_VERSION)/... -args $(CONFORMANCE_ARGS)
12761276

12771277
.PHONY: conformance-% ## Run the conformance test suite
1278-
conformance-%: $(CONFORMANCE_DIR)/$(GATEWAY_API_VERSION)/conformance_test.go
1279-
go test -mod=mod -ldflags=$(LDFLAGS) -tags conformance -test.v $(CONFORMANCE_DIR)/$(GATEWAY_API_VERSION)/... -args $(CONFORMANCE_ARGS) \
1278+
conformance-%: $(CONFORMANCE_DIR)/$(CONFORMANCE_VERSION)/conformance_test.go
1279+
go test -mod=mod -ldflags=$(LDFLAGS) -tags conformance -test.v $(CONFORMANCE_DIR)/$(CONFORMANCE_VERSION)/... -args $(CONFORMANCE_ARGS) \
12801280
-run-test=$*
12811281

12821282
#----------------------------------------------------------------------------------

0 commit comments

Comments
 (0)