Skip to content

Commit

Permalink
Merge 43e0d52 into 6add750
Browse files Browse the repository at this point in the history
  • Loading branch information
skriss authored Apr 6, 2022
2 parents 6add750 + 43e0d52 commit c7f8f0a
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/prbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -314,3 +314,42 @@ jobs:
steps: ${{ toJson(steps) }}
channel: '#contour-ci-notifications'
if: ${{ failure() && github.ref == 'refs/heads/main' }}
gateway-conformance:
runs-on: ubuntu-latest
needs: [build-image]
steps:
- uses: actions/checkout@v2
- name: Download image
uses: actions/download-artifact@v2
with:
name: image
path: image
- uses: actions/cache@v2
with:
# * Module download cache
# * Build cache (Linux)
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-${{ github.job }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-${{ github.job }}-go-
- uses: actions/setup-go@v2
with:
go-version: '1.18.0'
- name: add deps to path
run: |
./hack/actions/install-kubernetes-toolchain.sh $GITHUB_WORKSPACE/bin
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
- name: Gateway API conformance tests
env:
LOAD_PREBUILT_IMAGE: "true"
run: |
export CONTOUR_E2E_IMAGE="ghcr.io/projectcontour/contour:$(ls ./image/contour-*.tar | sed -E 's/.*-(.*).tar/\1/')"
make gateway-conformance
- uses: act10ns/slack@v1
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
channel: '#contour-ci-notifications'
if: ${{ failure() && github.ref == 'refs/heads/main' }}
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,13 @@ check-ingress-conformance: | install-contour-working run-ingress-conformance cle
run-ingress-conformance:
./test/scripts/run-ingress-conformance.sh

.PHONY: gateway-conformance
gateway-conformance: | setup-kind-cluster load-contour-image-kind run-gateway-conformance cleanup-kind ## Setup a kind cluster and run Gateway API conformance tests in it.

.PHONY: run-gatway-conformance
run-gateway-conformance: ## Run Gateway API conformance tests against the current cluster.
./test/scripts/run-gateway-conformance.sh

.PHONY: deploy-gcp-bench-cluster
deploy-gcp-bench-cluster:
./test/scripts/gcp-bench-cluster.sh deploy
Expand Down
43 changes: 43 additions & 0 deletions test/scripts/run-gateway-conformance.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#! /usr/bin/env bash

# Copyright Project Contour Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

set -o pipefail
set -o errexit
set -o nounset

readonly KUBECTL=${KUBECTL:-kubectl}
readonly IMG=${CONTOUR_E2E_IMAGE:-ghcr.io/projectcontour/contour:main}

echo "Using Contour image: ${IMG}"

${KUBECTL} apply -f examples/gateway-provisioner/00-common.yaml
${KUBECTL} apply -f examples/gateway-provisioner/01-roles.yaml
${KUBECTL} apply -f examples/gateway-provisioner/02-rolebindings.yaml
${KUBECTL} apply -f <(sed "s|ghcr.io/projectcontour/contour:main|$IMG|g; s|imagePullPolicy: Always|imagePullPolicy: IfNotPresent|g" examples/gateway-provisioner/03-gateway-provisioner.yaml)

${KUBECTL} apply -f - <<EOF
kind: GatewayClass
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: contour
spec:
controllerName: projectcontour.io/gateway-provisioner
EOF

cd $(mktemp -d)
git clone https://github.com/kubernetes-sigs/gateway-api
cd gateway-api
go test ./conformance -gateway-class=contour

0 comments on commit c7f8f0a

Please sign in to comment.