-
Notifications
You must be signed in to change notification settings - Fork 40
140 lines (124 loc) · 3.95 KB
/
.reusable_e2e_tests.yml
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
132
133
134
135
136
137
138
139
140
# This is a BASE reusable workflow used by other workflows for E2E testing with Gateway CE
name: Run E2E Tests
on:
workflow_call:
inputs:
base-url:
type: string
default: http://localhost:8002
gateway-image:
type: string
retries:
type: number
default: 0
load-test-image-from-artifact:
type: boolean
default: false
jobs:
e2e-tests:
strategy:
matrix:
suite:
- consumers
- certificates
- ca-certificates
# - data-plane-nodes
- keys
- key-sets
- misc
- plugins
- routes
- services
- snis
- upstreams
- vaults
router-flavor: [traditional_compatible]
include:
- suite: routes-expressions
router-flavor: expressions
fail-fast: false
name: ${{ matrix.suite }}
runs-on: ${{ vars.RUNS_ON }}
steps:
- name: Checkout source code
uses: actions/checkout@v3
- uses: pnpm/action-setup@v2 # version is determined from the packageManager field in package.json by default.
- name: Download release
timeout-minutes: 5
uses: actions/download-artifact@v4
with:
name: release
- name: Unpack release
run: tar xzvf ./release.tar.gz
- id: setup-node
name: Setup Node
timeout-minutes: 5
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: pnpm
- name: Install Playwright
timeout-minutes: 10
run: |
pnpm install:e2e
pnpm playwright install chromium
- name: Download test image
if: ${{ inputs.load-test-image-from-artifact }}
timeout-minutes: 5
uses: actions/download-artifact@v4
with:
name: docker-test-image
- name: Load test image
if: ${{ inputs.load-test-image-from-artifact }}
run: |
gunzip -c docker-test-image.tar.gz | docker load
- name: Select Gateway image
if: ${{ !inputs.load-test-image-from-artifact }}
id: select-gateway-image
uses: ./.github/actions/select-gateway-image
with:
current-image: ${{ inputs.gateway-image }}
- name: Start Kong traditional
if: ${{ matrix.suite != 'data-plane-nodes' }}
timeout-minutes: 10
working-directory: ${{ github.workspace }}
env:
GATEWAY_IMAGE: ${{ inputs.gateway-image }}
KONG_ROUTER_FLAVOR: ${{ matrix.router-flavor }}
run: |
_compose_exit=0
docker compose -f .ci/docker-compose.yml up -d kong --wait || _compose_exit=$?
docker compose -f .ci/docker-compose.yml logs
exit $_compose_exit
- name: Start Kong hybrid
if: ${{ matrix.suite == 'data-plane-nodes' }}
timeout-minutes: 10
working-directory: ${{ github.workspace }}
env:
GATEWAY_IMAGE: ${{ inputs.gateway-image }}
run: |
mkdir -p hybrid
chmod a+w ./hybrid
docker compose -f .ci/docker-compose.yml up kong-gen-cert
_compose_exit=0
docker compose -f .ci/docker-compose.yml up -d kong-hybrid-dp --scale kong-hybrid-dp=3 --wait || _compose_exit=$?
docker compose -f .ci/docker-compose.yml logs
exit $_compose_exit
- name: Run E2E tests
timeout-minutes: 10
env:
KM_TEST_GUI_URL: ${{ inputs.base-url }}
run: |
pnpm test:e2e \
--pass-with-no-tests \
--retries ${{ inputs.retries }} \
--reporter=list \
${{ format('specs/{0}/', matrix.suite) }}
- name: Upload results
if: ${{ !cancelled() }}
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: results-${{ matrix.suite }}
path: tests/playwright/test-results/
retention-days: 1