-
Notifications
You must be signed in to change notification settings - Fork 12
217 lines (190 loc) · 7.87 KB
/
Copy pathintegration-tests.yml
File metadata and controls
217 lines (190 loc) · 7.87 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
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
name: "Integration Tests"
permissions:
contents: read
on:
# Intentionally PR-only plus manual dispatch. Direct pushes to `main` are
# expected to arrive through PR merges, which already run this workflow.
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
env:
ORIGIN_PORT: 8888
ARTIFACTS_DIR: /tmp/integration-test-artifacts
WASM_ARTIFACT_PATH: /tmp/integration-test-artifacts/wasm/trusted-server-adapter-fastly.wasm
DOCKER_ARTIFACT_PATH: /tmp/integration-test-artifacts/docker/test-images.tar
jobs:
prepare-artifacts:
name: prepare integration artifacts
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Set up shared integration build environment
uses: ./.github/actions/setup-integration-test-env
with:
origin-port: ${{ env.ORIGIN_PORT }}
install-viceroy: "false"
- name: Package integration test artifacts
run: |
mkdir -p "$(dirname "$WASM_ARTIFACT_PATH")" "$(dirname "$DOCKER_ARTIFACT_PATH")"
cp target/wasm32-wasip1/release/trusted-server-adapter-fastly.wasm "$WASM_ARTIFACT_PATH"
docker save \
--output "$DOCKER_ARTIFACT_PATH" \
test-wordpress:latest test-nextjs:latest
- name: Upload integration test artifacts
uses: actions/upload-artifact@v4
with:
name: integration-test-artifacts
path: ${{ env.ARTIFACTS_DIR }}
retention-days: 1
integration-tests:
name: integration tests
needs: prepare-artifacts
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Set up integration test runtime
id: shared-setup
uses: ./.github/actions/setup-integration-test-env
with:
origin-port: ${{ env.ORIGIN_PORT }}
check-dependency-versions: "false"
install-viceroy: "true"
build-wasm: "false"
build-test-images: "false"
- name: Download integration test artifacts
uses: actions/download-artifact@v4
with:
name: integration-test-artifacts
path: ${{ env.ARTIFACTS_DIR }}
- name: Load integration test Docker images
run: docker load --input "$DOCKER_ARTIFACT_PATH"
- name: Run integration tests
run: >-
cargo test
--manifest-path crates/trusted-server-integration-tests/Cargo.toml
--target x86_64-unknown-linux-gnu
-- --include-ignored --skip test_wordpress_fastly --skip test_nextjs_fastly --test-threads=1
env:
WASM_BINARY_PATH: ${{ env.WASM_ARTIFACT_PATH }}
INTEGRATION_ORIGIN_PORT: ${{ env.ORIGIN_PORT }}
RUST_LOG: info
integration-tests-edgezero:
name: integration tests (EdgeZero entry point)
needs: prepare-artifacts
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Set up integration test runtime
id: shared-setup
uses: ./.github/actions/setup-integration-test-env
with:
origin-port: ${{ env.ORIGIN_PORT }}
check-dependency-versions: "false"
install-viceroy: "true"
build-wasm: "false"
build-test-images: "false"
- name: Download integration test artifacts
uses: actions/download-artifact@v4
with:
name: integration-test-artifacts
path: ${{ env.ARTIFACTS_DIR }}
# Exercises the EdgeZero entry point against the same WASM binary by
# pointing Viceroy at a config store with `edgezero_enabled = "true"`.
# Scoped to the container-free EC lifecycle suite (minimal TCP origin), a
# focused parity subset covering Fastly request conversion, config-store
# dispatch, publisher fallback proxying, and end-to-end EC/API wiring on
# the EdgeZero path. The legacy `integration-tests` job above still covers
# the full framework matrix.
- name: Run EdgeZero EC lifecycle tests
run: >-
cargo test
--manifest-path crates/trusted-server-integration-tests/Cargo.toml
--target x86_64-unknown-linux-gnu
test_ec_lifecycle_fastly
-- --include-ignored --test-threads=1
env:
WASM_BINARY_PATH: ${{ env.WASM_ARTIFACT_PATH }}
INTEGRATION_ORIGIN_PORT: ${{ env.ORIGIN_PORT }}
VICEROY_CONFIG_PATH: ${{ github.workspace }}/crates/trusted-server-integration-tests/fixtures/configs/viceroy-template-edgezero.toml
# Opt into the EdgeZero entry-point canary in test_ec_lifecycle_fastly.
# Only set here, so the legacy integration-tests job runs the same
# scenarios through legacy_main without asserting the EdgeZero-only 405.
EXPECT_EDGEZERO_ENTRY_POINT: "true"
RUST_LOG: info
browser-tests:
name: browser integration tests
needs: prepare-artifacts
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Set up browser test runtime
id: shared-setup
uses: ./.github/actions/setup-integration-test-env
with:
origin-port: ${{ env.ORIGIN_PORT }}
check-dependency-versions: "false"
install-viceroy: "true"
build-wasm: "false"
build-test-images: "false"
- name: Download integration test artifacts
uses: actions/download-artifact@v4
with:
name: integration-test-artifacts
path: ${{ env.ARTIFACTS_DIR }}
- name: Load integration test Docker images
run: docker load --input "$DOCKER_ARTIFACT_PATH"
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ steps.shared-setup.outputs.node-version }}
cache: npm
cache-dependency-path: crates/trusted-server-integration-tests/browser/package-lock.json
- name: Install Playwright
working-directory: crates/trusted-server-integration-tests/browser
run: |
npm ci
npx playwright install --with-deps chromium
- name: Run browser tests (Next.js)
working-directory: crates/trusted-server-integration-tests/browser
env:
WASM_BINARY_PATH: ${{ env.WASM_ARTIFACT_PATH }}
INTEGRATION_ORIGIN_PORT: ${{ env.ORIGIN_PORT }}
VICEROY_CONFIG_PATH: ${{ github.workspace }}/crates/trusted-server-integration-tests/fixtures/configs/viceroy-template.toml
TEST_FRAMEWORK: nextjs
PLAYWRIGHT_HTML_REPORT: playwright-report-nextjs
run: npx playwright test
- name: Upload Playwright report (Next.js)
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-nextjs
path: crates/trusted-server-integration-tests/browser/playwright-report-nextjs/
retention-days: 7
- name: Run browser tests (WordPress)
if: always()
working-directory: crates/trusted-server-integration-tests/browser
env:
WASM_BINARY_PATH: ${{ env.WASM_ARTIFACT_PATH }}
INTEGRATION_ORIGIN_PORT: ${{ env.ORIGIN_PORT }}
VICEROY_CONFIG_PATH: ${{ github.workspace }}/crates/trusted-server-integration-tests/fixtures/configs/viceroy-template.toml
TEST_FRAMEWORK: wordpress
PLAYWRIGHT_HTML_REPORT: playwright-report-wordpress
run: npx playwright test
- name: Upload Playwright report (WordPress)
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-wordpress
path: crates/trusted-server-integration-tests/browser/playwright-report-wordpress/
retention-days: 7
- name: Upload Playwright traces and screenshots
uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-traces
path: crates/trusted-server-integration-tests/browser/test-results/
retention-days: 7