-
Notifications
You must be signed in to change notification settings - Fork 35
93 lines (80 loc) · 2.98 KB
/
__e2e_chainsaw_tests.yaml
File metadata and controls
93 lines (80 loc) · 2.98 KB
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
name: E2E Chainsaw tests
run-name: "E2E Chainsaw tests ${{ format('{0}', inputs.node_image_version) }} "
on:
workflow_call:
inputs:
node_image_version:
description: "Kind node image version"
type: string
required: true
artifacts_run_id:
description: "Workflow run id that produced the e2e image artifact"
type: string
required: true
permissions:
contents: read
env:
MISE_VERBOSE: 1
MISE_DEBUG: 1
jobs:
e2e-tests-chainsaw:
timeout-minutes: ${{ fromJSON(vars.GHA_EXTENDED_TIMEOUT_MINUTES || 60) }}
runs-on: ubuntu-latest
name: ${{ format('{0}', inputs.node_image_version) }}
env:
IMG: kong-operator
TAG: e2e-${{ github.sha }}
CLUSTER_NAME: e2e-chainsaw
steps:
- name: Harden Runner
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
with:
egress-policy: audit
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: download e2e image artifact
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
name: kong-operator-e2e-image-${{ inputs.artifacts_run_id }}
run-id: ${{ inputs.artifacts_run_id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: load docker image
run: docker load -i kong-operator_e2e.tar
- uses: jdx/mise-action@5228313ee0372e111a38da051671ca30fc5a96db # v3.6.3
with:
install_args: github:Kong/kubernetes-testing-framework http:helm
- name: Create k8s KinD Cluster with ktf
run: |
ktf environments create \
--name ${{ env.CLUSTER_NAME }} \
--addon metallb \
--addon cert-manager \
--kubernetes-version ${{ inputs.node_image_version }}
- name: Load image to kind cluster
run: kind load docker-image ${{ env.IMG }}:${{ env.TAG }} --name ${{ env.CLUSTER_NAME }}
- name: Deploy operator with Helm
run: |
helm install kong-operator charts/kong-operator \
--namespace kong-system \
--create-namespace \
--set image.repository=${{ env.IMG }} \
--set image.tag=${{ env.TAG }} \
--set env.enable_controller_konnect=true \
--wait
- name: run chainsaw e2e tests
id: chainsaw-tests
run: make test.e2e.chainsaw
env:
KONNECT_TOKEN: ${{ secrets.KONG_TEST_KONNECT_ACCESS_TOKEN }}
KONNECT_SERVER_URL: us.api.konghq.tech
TEST_ID: ${{ github.run_id }}
- name: Upload debug snapshots as artifacts
if: always() && steps.chainsaw-tests.outcome == 'failure'
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: chainsaw-debug-snapshots-${{ github.run_id }}
path: /tmp/chainsaw/
if-no-files-found: ignore
retention-days: 3
- name: Clean up debug snapshots
if: always() && steps.chainsaw-tests.outcome == 'failure'
run: rm -rf /tmp/chainsaw