forked from k8sgateway/k8sgateway
-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (120 loc) · 6.12 KB
/
pr-kubernetes-tests.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Kubernetes Tests
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
env:
VERSION: '1.0.0-ci1'
GITHUB_TOKEN: ${{ github.token }}
jobs:
prepare_env:
name: Prepare Environment
runs-on: ubuntu-22.04
timeout-minutes: 5
outputs:
should-auto-succeed-kube-tests: ${{ steps.run-strategy.outputs.auto_succeed }}
steps:
- name: Cancel Previous Actions
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- id: checkout-code
uses: actions/checkout@v4
with:
# We require gathering the branch and tag history since we rely on a `git diff`
# which compares the state of two branches
fetch-depth: 0
- id: process-skip-directives
uses: ./.github/workflows/composite-actions/process-skip-directives
with:
base-ref: ${{ github.base_ref }}
- id: run-strategy
name: Determine Test Run Strategy
run: |
skip_kube_tests=${{ steps.process-skip-directives.outputs.skip-kube-tests }}
if [[ ! -z $skip_kube_tests && $skip_kube_tests = true ]] ; then
echo "auto_succeed=true" >> $GITHUB_OUTPUT
fi
end_to_end_tests:
name: End-to-End (${{ matrix.test.cluster-name }})
needs: prepare_env
runs-on: ubuntu-22.04
timeout-minutes: 60
if: ${{ !github.event.pull_request.draft }}
strategy:
fail-fast: false
matrix:
# We intentionally set an upper threshold of 30 minutes for our End-to-End tests
# Our goal is to load balance tests in a way that allows quick iteration on PRs
# If tests are exceeding the 30-minute limit, please see:
# /test/kubernetes/e2e/load_balancing_tests.md
#
# Above each test below, we document the latest date/time for the GitHub action step to run
# NOTE: We use the GitHub action step time (as opposed to the `go test` time), because it is easier to capture
test:
# Nov 14, 2024: 22 minutes
- cluster-name: 'cluster-one'
go-test-args: '-v -timeout=25m'
go-test-run-regex: '^TestK8sGateway$$/^RouteDelegation$$|^TestGlooctlGlooGatewayEdgeGateway$$|^TestGlooctlK8sGateway$$'
# Nov 14, 2024: 22 minutes
- cluster-name: 'cluster-two'
go-test-args: '-v -timeout=25m'
go-test-run-regex: '^TestK8sGatewayIstioRevision$$|^TestRevisionIstioRegression$$|^TestK8sGateway$$/^Deployer$$|^TestK8sGateway$$/^RouteOptions$$|^TestK8sGateway$$/^VirtualHostOptions$$|^TestK8sGateway$$/^Upstreams$$|^TestK8sGateway$$/^HeadlessSvc$$|^TestK8sGateway$$/^PortRouting$$|^TestK8sGatewayMinimalDefaultGatewayParameters$$|^TestK8sGateway$$/^DirectResponse$$|^TestK8sGateway$$/^HttpListenerOptions$$|^TestK8sGateway$$/^ListenerOptions$$|^TestK8sGateway$$/^GlooAdminServer$$'
# Nov 14, 2024: 23 minutes
- cluster-name: 'cluster-three'
go-test-args: '-v -timeout=30m'
go-test-run-regex: '(^TestK8sGatewayIstioAutoMtls$$|^TestAutomtlsIstioEdgeApisGateway$$|^TestIstioEdgeApiGateway$$|^TestIstioRegression$$)'
# Nov 14, 2024: 21 minutes
- cluster-name: 'cluster-four'
go-test-args: '-v -timeout=30m'
go-test-run-regex: '(^TestK8sGatewayIstio$$|^TestGlooGatewayEdgeGateway$$|^TestGlooctlIstioInjectEdgeApiGateway$$)'
# Nov 14, 2024: 30 minutes
# TODO (sheidkamp) rebalance tests
- cluster-name: 'cluster-five'
go-test-args: '-v -timeout=35m'
go-test-run-regex: '^TestFullEnvoyValidation$$|^TestValidationStrict$$|^TestValidationAlwaysAccept$$|^TestTransformationValidationDisabled$$|^TestGloomtlsGatewayEdgeGateway$$|^TestWatchNamespaceSelector$$'
# Nov 14, 2024: 23 minutes
- cluster-name: 'cluster-six'
go-test-args: '-v -timeout=25m'
go-test-run-regex: '^TestDiscoveryWatchlabels$$|^TestK8sGatewayNoValidation$$|^TestHelm$$|^TestHelmSettings$$|^TestK8sGatewayAws$$|^TestK8sGateway$$/^CRDCategories$$|^TestK8sGateway$$/^HTTPRouteServices$$|^TestK8sGateway$$/^TCPRouteServices$$|^TestZeroDowntimeRollout$$'
# In our PR tests, we run the suite of tests using the upper ends of versions that we claim to support
# The versions should mirror: https://docs.solo.io/gloo-edge/latest/reference/support/
version-files:
- file: './.github/workflows/.env/pr-tests/versions.env'
steps:
- id: auto-succeed-tests
if: needs.prepare_env.outputs.should-auto-succeed-kube-tests == 'true'
run: |
echo "Regression tests auto-succeeded"
- uses: actions/checkout@v4
- name: Prep Go Runner
uses: ./.github/workflows/composite-actions/prep-go-runner
if: needs.prepare_env.outputs.should-auto-succeed-kube-tests != 'true'
# The dotenv action is used to load key-value pairs from files.
# In this case, the file is specified in the matrix and will contain the versions of the tools to use
- name: Dotenv Action
uses: falti/[email protected]
if: needs.prepare_env.outputs.should-auto-succeed-kube-tests != 'true'
id: dotenv
with:
path: ${{ matrix.version-files.file }}
log-variables: true
- id: setup-kind-cluster
name: Setup KinD Cluster
if: needs.prepare_env.outputs.should-auto-succeed-kube-tests != 'true'
uses: ./.github/workflows/composite-actions/setup-kind-cluster
with:
cluster-name: ${{ matrix.test.cluster-name }}
kind-node-version: ${{ steps.dotenv.outputs.node_version }}
kind-version: ${{ steps.dotenv.outputs.kind_version }}
kubectl-version: ${{ steps.dotenv.outputs.kubectl_version }}
helm-version: ${{ steps.dotenv.outputs.helm_version }}
istio-version: ${{ steps.dotenv.outputs.istio_version }}
- id: run-tests
if: needs.prepare_env.outputs.should-auto-succeed-kube-tests != 'true'
uses: ./.github/workflows/composite-actions/kubernetes-e2e-tests
with:
cluster-name: ${{ matrix.test.cluster-name }}
test-args: ${{ matrix.test.go-test-args }}
run-regex: ${{ matrix.test.go-test-run-regex }}
istio-version: ${{ steps.dotenv.outputs.istio_version }}
matrix-label: "pr"