Skip to content

Conversation

@electricjesus
Copy link
Member

@electricjesus electricjesus commented Dec 17, 2025

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/GatewayAPI resource with matching gateway.networking.k8s.io/Gateway then Gateway Conformance tests are run.

Related issues/PRs

N/A

Todos

  • Tests
  • Documentation
  • Release note

Release Note

TBD

Copilot AI review requested due to automatic review settings December 17, 2025 20:07
@electricjesus electricjesus requested review from a team as code owners December 17, 2025 20:07
@marvin-tigera marvin-tigera added this to the Calico v3.32.0 milestone Dec 17, 2025
@marvin-tigera marvin-tigera added release-note-required Change has user-facing impact (no matter how small) docs-pr-required Change is not yet documented labels Dec 17, 2025
Copy link
Contributor

Copilot AI left a 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

- 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']})"
Copy link

Copilot AI Dec 17, 2025

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.

Suggested change
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']})"

Copilot uses AI. Check for mistakes.
- 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']})"
Copy link

Copilot AI Dec 17, 2025

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.

Suggested change
when: "true or change_in(['/gateway', '/e2e/cmd/gateway', '/third_party/envoy-gateway'], {pipeline_file: 'ignore', exclude: ['/**/.gitignore', '/**/README.md', '/**/LICENSE']})"
when: "true"

Copilot uses AI. Check for mistakes.
@electricjesus electricjesus added release-note-not-required Change has no user-facing impact and removed release-note-required Change has user-facing impact (no matter how small) labels Dec 17, 2025
@electricjesus electricjesus requested a review from a team as a code owner December 17, 2025 20:40
Copy link
Contributor

Copilot AI left a 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 \
Copy link

Copilot AI Dec 17, 2025

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.

Suggested change
-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.

Copilot uses AI. Check for mistakes.
@electricjesus electricjesus force-pushed the gateway-api-conformance-tests branch from 8fca315 to 4251945 Compare December 17, 2025 21:15
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
@electricjesus electricjesus force-pushed the gateway-api-conformance-tests branch from aa796e9 to 41c5c81 Compare December 24, 2025 12:35
…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
Copy link
Member

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?

Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-pr-required Change is not yet documented release-note-not-required Change has no user-facing impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants