forked from kgateway-dev/kgateway
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.github,Makefile: Add support for generating conformance reports
Signed-off-by: timflannagan <[email protected]>
- Loading branch information
1 parent
67ac4e5
commit 7ba1553
Showing
5 changed files
with
142 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Run Conformance Tests | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
image-variant: | ||
description: "Image variant to use" | ||
required: true | ||
type: choice | ||
options: | ||
- standard | ||
- distroless | ||
profile: | ||
description: "Conformance profile to run" | ||
required: true | ||
type: choice | ||
options: | ||
- standard | ||
- experimental | ||
version: | ||
description: "Gloo Gateway version to deploy and test (e.g. 1.17.3)" | ||
required: false | ||
type: string | ||
|
||
jobs: | ||
run-conformance-tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
# kube-version: | ||
# - kind: ${{ inputs.kube-version }} | ||
# kubectl: ${{ inputs.kube-version }} | ||
# helm: v3.8.0 | ||
# node: v16.13.0 | ||
kube-version: | ||
- node: 'v1.29.2@sha256:51a1434a5397193442f0be2a297b488b6c919ce8a3931be0ce822606ea5ca245' | ||
kubectl: 'v1.29.2' | ||
kind: 'v0.20.0' | ||
helm: 'v3.14.4' | ||
image-variant: | ||
- ${{ inputs.image-variant }} | ||
profile: | ||
- ${{ inputs.profile }} | ||
version: | ||
- ${{ inputs.version }} | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: timflannagan/gloo | ||
|
||
# TODO: provide version input to this action | ||
- name: Run Conformance Tests | ||
uses: ./.github/workflows/composite-actions/kube-gateway-api-conformance-tests | ||
|
||
# TODO: produce slack notification? | ||
|
||
# TODO: generate date-specific report files | ||
# See https://github.com/projectcontour/contour/blob/main/test/conformance/gatewayapi/gateway_conformance_test.go | ||
# for an example of how to generate a report file. | ||
|
||
# TODO: copy artifacts and create a PR against the gateway-api repo. | ||
# Note: it would be best if we forked that repo and tested automation | ||
# against that fork first. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -167,7 +167,6 @@ install-go-tools: mod-download ## Download and install Go dependencies | |
go install github.com/cratonica/2goarray | ||
go install github.com/golang/mock/mockgen | ||
go install github.com/saiskee/gettercheck | ||
go install github.com/onsi/ginkgo/v2/ginkgo@$(GINKGO_VERSION) | ||
# This version must stay in sync with the version used in CI: .github/workflows/static-analysis.yaml | ||
go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(LINTER_VERSION) | ||
go install github.com/quasilyte/go-ruleguard/cmd/[email protected] | ||
|
@@ -1187,17 +1186,26 @@ build-test-chart: ## Build the Helm chart and place it in the _test directory | |
# Targets for running Kubernetes Gateway API conformance tests | ||
#---------------------------------------------------------------------------------- | ||
|
||
# FIXME(tim): Re-evaluate the --version & --contact flags. I think both are fine, but need to validate. | ||
# TODO(tim): We should have a single Makefile target to drive all of this... | ||
# Note(tim): Looks like adding the "TLS" profile breaks everything. We obviously don't support the "MESH" profile either. | ||
# Note(tim): All of the profiles and suites were refactored in the release-1.1 branch. The profiles became more granular | ||
# among other things like the experimental_conformance_test.go file being removed. | ||
|
||
# Pull the conformance test suite from the k8s gateway api repo and copy it into the test dir. | ||
$(TEST_ASSET_DIR)/conformance/conformance_test.go: | ||
mkdir -p $(TEST_ASSET_DIR)/conformance | ||
echo "//go:build conformance" > $@ | ||
cat $(shell go list -json -m sigs.k8s.io/gateway-api | jq -r '.Dir')/conformance/conformance_test.go >> $@ | ||
go fmt $@ | ||
|
||
CONFORMANCE_ARGS:=-gateway-class=gloo-gateway -supported-features=Gateway,ReferenceGrant,HTTPRoute,HTTPRouteQueryParamMatching,HTTPRouteMethodMatching,HTTPRouteResponseHeaderModification,HTTPRoutePortRedirect,HTTPRouteHostRewrite,HTTPRouteSchemeRedirect,HTTPRoutePathRedirect,HTTPRouteHostRewrite,HTTPRoutePathRewrite,HTTPRouteRequestMirror | ||
$(TEST_ASSET_DIR)/conformance/experimental_conformance_test.go: | ||
mkdir -p $(TEST_ASSET_DIR)/conformance | ||
cat $(shell go list -json -m sigs.k8s.io/gateway-api | jq -r '.Dir')/conformance/experimental_conformance_test.go >> $@ | ||
go fmt $@ | ||
|
||
CONFORMANCE_ARGS := -gateway-class=gloo-gateway -supported-features=Gateway,ReferenceGrant,HTTPRoute,HTTPRouteQueryParamMatching,HTTPRouteMethodMatching,HTTPRouteResponseHeaderModification,HTTPRoutePortRedirect,HTTPRouteHostRewrite,HTTPRouteSchemeRedirect,HTTPRoutePathRedirect,HTTPRouteHostRewrite,HTTPRoutePathRewrite,HTTPRouteRequestMirror | ||
|
||
# Run the conformance test suite | ||
.PHONY: conformance | ||
.PHONY: conformance ## Run the conformance test suite | ||
conformance: $(TEST_ASSET_DIR)/conformance/conformance_test.go | ||
go test -ldflags=$(LDFLAGS) -tags conformance -test.v $(TEST_ASSET_DIR)/conformance/... -args $(CONFORMANCE_ARGS) | ||
|
||
|
@@ -1207,6 +1215,14 @@ conformance-%: $(TEST_ASSET_DIR)/conformance/conformance_test.go | |
go test -ldflags=$(LDFLAGS) -tags conformance -test.v $(TEST_ASSET_DIR)/conformance/... -args $(CONFORMANCE_ARGS) \ | ||
-run-test=$* | ||
|
||
.PHONY: conformance-experimental ## Run the extended conformance test suite | ||
conformance-experimental: CONFORMANCE_ARGS += -conformance-profiles=HTTP -report-output=$(TEST_ASSET_DIR)/conformance/report.yaml -organization=solo.io -project=gloo -version=$(VERSION) -url=github.com/solo-io/gloo -contact=https://solo.io | ||
conformance-experimental: $(TEST_ASSET_DIR)/conformance/conformance_test.go $(TEST_ASSET_DIR)/conformance/experimental_conformance_test.go | ||
go test -ldflags=$(LDFLAGS) \ | ||
-run TestExperimentalConformance \ | ||
-test.v $(TEST_ASSET_DIR)/conformance/... \ | ||
-args $(CONFORMANCE_ARGS) \ | ||
|
||
#---------------------------------------------------------------------------------- | ||
# Security Scan | ||
#---------------------------------------------------------------------------------- | ||
|