generated from knative-extensions/sample-controller
-
Notifications
You must be signed in to change notification settings - Fork 89
97 lines (77 loc) · 3.06 KB
/
kind-e2e.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: e2e
on:
pull_request:
branches: [ 'main', 'release-*' ]
defaults:
run:
shell: bash
jobs:
test:
name: test
runs-on: ubuntu-latest
strategy:
fail-fast: false # Keep running if one leg fails.
matrix:
k8s-version:
- v1.28.x
- v1.29.x
test-suite:
- ./test/conformance
- ./test/e2e
istio-profile:
- no-mesh
- ambient
env:
KO_DOCKER_REPO: kind.local
# Use a semi-random cluster suffix, but somewhat predictable
# so reruns don't just give us a completely new value.
CLUSTER_SUFFIX: c${{ github.run_id }}.local
steps:
- uses: knative/actions/setup-go@main
- uses: ko-build/[email protected]
- uses: actions/checkout@v4
- uses: chainguard-dev/actions/setup-kind@main
id: kind
with:
k8s-version: ${{ matrix.k8s-version }}
kind-worker-count: 1
cluster-suffix: "${CLUSTER_SUFFIX}"
- name: Install Knative net-istio
run: |
set -o pipefail
# Replace cluster.local with random suffix.
sed -ie "s/cluster\.local/${CLUSTER_SUFFIX}/g" third_party/istio-latest/istio-kind-${{ matrix.istio-profile }}/istio.yaml
# Deploy Istio
kubectl apply -f ./third_party/istio-latest/istio-kind-${{ matrix.istio-profile }}
# Remove Knative Certificate as we are running without Serving CRs
rm -f config/700-istio-knative-certificate.yaml
# Build and Publish our containers to the docker daemon (including test assets)
ko resolve --platform=linux/amd64 -f test/config/ -f config/ | kubectl apply -f -
CONFIG_ISTIO="./third_party/istio-latest/istio-kind-${{ matrix.istio-profile }}/config-istio.yaml"
if [[ -f "${CONFIG_ISTIO}" ]]; then
kubectl apply -f "${CONFIG_ISTIO}"
fi
echo "GATEWAY_NAMESPACE_OVERRIDE=istio-system" >> $GITHUB_ENV
- name: Upload Test Images
run: |
# Build and Publish our test images to the docker daemon.
./test/upload-test-images.sh
- name: Wait for Ready
run: |
echo Waiting for Pods to become ready.
# # TODO: Find a good way to do this with chaos enabled.
# kubectl wait pod --for=condition=Ready -n knative-serving -l '!job-name'
kubectl wait pod --for=condition=Ready -n ${GATEWAY_NAMESPACE_OVERRIDE} -l '!job-name'
# For debugging.
kubectl get pods --all-namespaces
- name: Run e2e Tests
run: |
set -x
# Exclude the control-plane node, which doesn't seem to expose the nodeport service.
IPS=( $(kubectl get nodes -lkubernetes.io/hostname!=kind-control-plane -ojsonpath='{.items[*].status.addresses[?(@.type=="InternalIP")].address}') )
# Run the tests tagged as e2e on the KinD cluster.
go test -race -count=1 -short -timeout=20m -tags=e2e ${{ matrix.test-suite }} \
--enable-alpha --enable-beta \
--ingressendpoint="${IPS[0]}" \
--ingressClass=istio.ingress.networking.knative.dev \
--cluster-suffix=$CLUSTER_SUFFIX