-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add Gateway API conformance tests to CI pipeline #11581
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add Gateway API conformance tests to CI pipeline #11581
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds Gateway API conformance testing to the Calico CI pipeline by integrating the upstream Gateway API v1.3.0 conformance test suite to validate Calico's Gateway API implementation through Envoy Gateway.
Key Changes:
- Adds Gateway API v1.3.0 dependency and conformance test infrastructure
- Creates new e2e test binary for Gateway API conformance testing
- Integrates Gateway API conformance tests into SemaphoreCI pipeline with automatic artifact collection
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| go.mod | Adds Gateway API v1.3.0 dependency and updates jsonreference version |
| gateway/test/conformance/manifests/gatewayclass.yaml | Defines GatewayClass resource for conformance testing |
| gateway/test/conformance/manifests/gateway.yaml | Defines Gateway resource for conformance testing infrastructure |
| gateway/test/conformance/README.md | Comprehensive documentation for running and debugging Gateway API conformance tests |
| e2e/cmd/gateway/e2e_test.go | Implements conformance test runner that integrates upstream Gateway API test suite |
| e2e/Makefile | Adds build target for Gateway API conformance test binary |
| Makefile | Adds Makefile target to run Gateway API conformance tests against existing cluster |
| .semaphore/semaphore.yml.d/blocks/20-gateway-conformance.yml | Defines SemaphoreCI block configuration for Gateway API conformance tests |
| .semaphore/semaphore.yml | Integrates Gateway API conformance test block into main CI pipeline |
| .semaphore/semaphore-scheduled-builds.yml | Integrates Gateway API conformance tests into scheduled builds |
.semaphore/semaphore.yml
Outdated
| - name: google-service-account-for-gce | ||
| - name: "E2E tests: Gateway API Conformance" | ||
| run: | ||
| when: "false or change_in(['/gateway', '/e2e/cmd/gateway', '/third_party/envoy-gateway'], {pipeline_file: 'ignore', exclude: ['/**/.gitignore', '/**/README.md', '/**/LICENSE']})" |
Copilot
AI
Dec 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition starts with "false or" which means the Gateway API conformance tests will only run when files change in the specified directories, never by default. This differs from the block definition in 20-gateway-conformance.yml which uses "${FORCE_RUN} or". This inconsistency means FORCE_RUN won't work as expected. Change "false" to "${FORCE_RUN}" to align with the block definition and allow manual triggering.
| when: "false or change_in(['/gateway', '/e2e/cmd/gateway', '/third_party/envoy-gateway'], {pipeline_file: 'ignore', exclude: ['/**/.gitignore', '/**/README.md', '/**/LICENSE']})" | |
| when: "${FORCE_RUN} or change_in(['/gateway', '/e2e/cmd/gateway', '/third_party/envoy-gateway'], {pipeline_file: 'ignore', exclude: ['/**/.gitignore', '/**/README.md', '/**/LICENSE']})" |
| - name: google-service-account-for-gce | ||
| - name: "E2E tests: Gateway API Conformance" | ||
| run: | ||
| when: "true or change_in(['/gateway', '/e2e/cmd/gateway', '/third_party/envoy-gateway'], {pipeline_file: 'ignore', exclude: ['/**/.gitignore', '/**/README.md', '/**/LICENSE']})" |
Copilot
AI
Dec 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition "true or change_in(...)" means the Gateway API conformance tests will always run in scheduled builds regardless of file changes, which makes the change_in() check redundant. This appears intentional for scheduled builds but the redundant condition reduces clarity. Consider using just "true" or documenting why both conditions are present.
| when: "true or change_in(['/gateway', '/e2e/cmd/gateway', '/third_party/envoy-gateway'], {pipeline_file: 'ignore', exclude: ['/**/.gitignore', '/**/README.md', '/**/LICENSE']})" | |
| when: "true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 28 out of 29 changed files in this pull request and generated 1 comment.
| KUBECONFIG=$(KIND_KUBECONFIG) ./e2e/bin/gateway/e2e.test \ | ||
| -gateway-class=calico-gateway \ | ||
| -supported-features=Gateway,HTTPRoute \ | ||
| -cleanup-base-resources=true \ |
Copilot
AI
Dec 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The -allow-crds-mismatch flag is included without explanation. This flag appears to allow running tests even when CRD versions don't match exactly, which could mask compatibility issues. Consider adding a comment explaining why this flag is necessary for the Calico Gateway API conformance tests.
| -cleanup-base-resources=true \ | |
| -cleanup-base-resources=true \ | |
| # Allow minor version skew between the Gateway API CRDs installed by Calico | |
| # and the versions expected by the upstream conformance test binary. This | |
| # keeps the tests runnable while our bundled CRDs may lag slightly behind | |
| # the latest upstream definitions. |
8fca315 to
4251945
Compare
Implements Gateway API conformance testing in the Calico CI pipeline using Tigera's hardened Envoy Gateway distribution. Implementation: - e2e test binary integrating upstream Gateway API v1.3.0 conformance suite - GatewayAPI operator resource to enable Tigera Gateway support - Test manifests (Gateway resource using tigera-gateway-class) - Makefile targets for building and running tests - SemaphoreCI pipeline block for automated testing - Comprehensive README with local testing workflow Testing: - Supports Gateway and HTTPRoute conformance profiles - 260+ conformance test cases covering hostname matching, cross-namespace routing, invalid references, and HTTP routing - Uses embedded manifests from upstream conformance suite - Handles experimental channel CRDs via -allow-crds-mismatch flag Dependencies: - sigs.k8s.io/gateway-api v1.3.0 The conformance tests validate that Calico's Gateway API implementation meets the standard specification and catch regressions early.
Auto-generated changes from previous commit: - semaphore.yml: Add Gateway API conformance test block - semaphore-scheduled-builds.yml: Add Gateway API conformance test block - deps.txt: Update module dependencies for Gateway API v1.3.0
Use hardcoded path hack/test/kind/kind-kubeconfig.yaml instead of
${KIND_KUBECONFIG} variable which is not available in shell context.
KIND_KUBECONFIG is a Makefile variable, not a shell environment variable.
Add kubectl wait for gatewayclasses.gateway.networking.k8s.io CRD to be established before attempting to wait for tigera-gateway-class resource. The Tigera operator needs time to install Gateway API CRDs after the GatewayAPI resource is applied. Without this wait, the subsequent kubectl wait for the gatewayclass resource fails with 'server doesn't have a resource type gatewayclass'.
Replace single kubectl wait command with two-step approach: 1. Poll until CRD exists (handles operator installation delay) 2. Wait for Established condition (ensures CRD is ready) This fixes the issue where kubectl wait fails immediately if the gatewayclasses.gateway.networking.k8s.io CRD doesn't exist yet when the Tigera operator is still installing it.
Build envoy-gateway, envoy-proxy, and envoy-ratelimit images from current commit and load them into KIND cluster before running conformance tests. This ensures Gateway API conformance tests validate the current codebase rather than pulling released images from external registries. Changes: - Build Gateway images before creating KIND cluster - Load built images into KIND after cluster creation - Scale tigera-operator back up before applying GatewayAPI resource (operator was scaled to 0 by kind-k8st-setup) - Wait for operator to be available before proceeding This follows the same pattern as other e2e tests: build current code, deploy to KIND, and run tests against it.
Extract Gateway image building and setup steps from CI configuration into a reusable Makefile target (e2e-gateway-setup). This simplifies the CI configuration from 38 lines to 7 lines while making the Gateway setup process reusable for local development. The new target handles: - Building Gateway images (envoy-gateway, envoy-proxy, envoy-ratelimit) - Loading images into KIND cluster - Scaling tigera-operator back up - Applying GatewayAPI resource and waiting for readiness Changes: - Add e2e-gateway-setup target to root Makefile - Simplify Gateway conformance CI block to call new target - Add progress messages for better visibility Net reduction: 31 lines of code
aa796e9 to
41c5c81
Compare
…references - Use $(KIND) and $(KUBECTL) Make variables instead of bare commands to ensure tools are found from correct cached locations - Add envoy-gateway, envoy-proxy, envoy-ratelimit to K8ST_IMAGE_TARS - Build and tag envoy images as calico/envoy-*:test-build in node/Makefile - Update load_images_on_kind_cluster.sh to load envoy image tars - Simplify e2e-gateway-setup to only scale operator and apply resources (images are now loaded by kind-k8st-setup) - Restore envoy CI blocks that were temporarily deleted - Update gateway conformance block change detection paths - Regenerate semaphore.yml from updated blocks
Add BUILD_CACHE_GROUP=node to Gateway API Conformance block to share Go build cache with other node-related blocks, avoiding rebuilding from scratch.
- Poll for GatewayClass creation instead of immediately waiting - Show operator logs if GatewayClass is not created - Verify envoy images are loaded in KIND before applying GatewayAPI - Display GatewayAPI resource status after applying This will help diagnose why tigera-gateway-class is not being created by the operator.
| @@ -1,15 +0,0 @@ | |||
| - name: API | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@electricjesus was it intentional to remove all of these blocks? Seems wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey casey - just got back to this. intentional but only temporary so i can "focus" semaphore only on the conformance tests that i want
Description
This PR adds Gateway API conformance testing to the Calico CI pipeline.
Automated conformance testing to ensure Calico's Gateway API implementation meets the standard specification and to catch regressions early.
Installs latest calicoreates an
operator.tigera.io/GatewayAPIresource with matchinggateway.networking.k8s.io/Gatewaythen Gateway Conformance tests are run.Related issues/PRs
N/A
Todos
Release Note