-
Notifications
You must be signed in to change notification settings - Fork 0
270 lines (229 loc) · 10.4 KB
/
e2e.yml
File metadata and controls
270 lines (229 loc) · 10.4 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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
name: E2E
on:
pull_request:
branches: [ "main" ]
push:
branches: [ "main" ]
jobs:
e2e:
runs-on: ubuntu-latest
timeout-minutes: 120
env:
E2E_RETRY_COUNT: 3
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Check E2E projects in solution
id: check-e2e
run: |
# Detect which E2E projects are available in the solution.
for proj in Picea.Abies.Conduit.Testing.E2E \
Picea.Abies.Counter.Testing.E2E \
Picea.Abies.Templates.Testing.E2E \
Picea.Abies.UI.Demo.Testing.E2E; do
key=$(echo "$proj" | tr '.' '_' | tr '-' '_')
if grep -q "$proj" Picea.Abies.sln; then
echo "${key}=true" >> $GITHUB_OUTPUT
echo "✅ $proj found in solution"
else
echo "${key}=false" >> $GITHUB_OUTPUT
echo "⚠️ $proj not in solution — skipping"
fi
done
- name: Setup .NET 10
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Install WASM workloads
run: dotnet workload install wasm-experimental wasm-tools
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build --no-restore -c Debug
- name: Cache Playwright browsers
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: ms-playwright-${{ runner.os }}-${{ hashFiles('**/*.csproj', '**/packages.lock.json') }}
restore-keys: |
ms-playwright-${{ runner.os }}-
- name: Runner preflight checks
run: |
echo "Disk usage"
df -h
echo "Memory"
free -m
echo "CPU"
nproc
# ── Playwright browser install (one per E2E project) ──────────
- name: Install Playwright browsers (Conduit E2E)
if: steps.check-e2e.outputs.Picea_Abies_Conduit_Testing_E2E == 'true'
run: pwsh bin/Debug/net10.0/playwright.ps1 install --with-deps
working-directory: Picea.Abies.Conduit.Testing.E2E
- name: Install Playwright browsers (Counter E2E)
if: steps.check-e2e.outputs.Picea_Abies_Counter_Testing_E2E == 'true'
run: pwsh bin/Debug/net10.0/playwright.ps1 install --with-deps
working-directory: Picea.Abies.Counter.Testing.E2E
- name: Install Playwright browsers (Templates E2E)
if: steps.check-e2e.outputs.Picea_Abies_Templates_Testing_E2E == 'true'
run: pwsh bin/Debug/net10.0/playwright.ps1 install --with-deps
working-directory: Picea.Abies.Templates.Testing.E2E
- name: Install Playwright browsers (UI Demo E2E)
if: steps.check-e2e.outputs.Picea_Abies_UI_Demo_Testing_E2E == 'true'
run: pwsh bin/Debug/net10.0/playwright.ps1 install --with-deps
working-directory: Picea.Abies.UI.Demo.Testing.E2E
# ── Conduit E2E ───────────────────────────────────────────────
- name: Run Conduit E2E tests
if: steps.check-e2e.outputs.Picea_Abies_Conduit_Testing_E2E == 'true'
id: conduit-e2e
continue-on-error: true
run: |
mkdir -p TestResults
attempt=1
while [ "$attempt" -le "$E2E_RETRY_COUNT" ]; do
echo "Conduit E2E attempt ${attempt}/${E2E_RETRY_COUNT}"
if dotnet test --project Picea.Abies.Conduit.Testing.E2E/Picea.Abies.Conduit.Testing.E2E.csproj \
--no-build -c Debug \
--results-directory TestResults \
-- --treenode-filter "/*/*/*/*[Category!=Performance]" \
--report-trx --report-trx-filename conduit-e2e.trx \
--maximum-parallel-tests 1 --timeout 1h; then
exit 0
fi
if [ "$attempt" -lt "$E2E_RETRY_COUNT" ]; then
echo "Retrying Conduit E2E in 20s..."
sleep 20
fi
attempt=$((attempt + 1))
done
echo "❌ Conduit E2E failed after ${E2E_RETRY_COUNT} attempts"
exit 1
- name: Analyze Conduit E2E results
if: always() && steps.check-e2e.outputs.Picea_Abies_Conduit_Testing_E2E == 'true'
run: |
echo "TRX discovery (Conduit):"
find . -name "conduit-e2e.trx" -type f | sed 's#^./##' || true
TRX_FILE=$(find . -name "conduit-e2e.trx" -type f | head -1)
if [ -z "$TRX_FILE" ]; then
echo "❌ TRX file not found for Conduit E2E"
exit 2
fi
python3 scripts/analyze_e2e_results.py "$TRX_FILE" --strict --min-pass-rate 1.0 --max-timeout-rate 0
# ── Counter E2E ───────────────────────────────────────────────
- name: Run Counter E2E tests
if: always() && steps.check-e2e.outputs.Picea_Abies_Counter_Testing_E2E == 'true'
id: counter-e2e
continue-on-error: true
run: |
mkdir -p TestResults
attempt=1
while [ "$attempt" -le "$E2E_RETRY_COUNT" ]; do
echo "Counter E2E attempt ${attempt}/${E2E_RETRY_COUNT}"
if dotnet test --project Picea.Abies.Counter.Testing.E2E/Picea.Abies.Counter.Testing.E2E.csproj \
--no-build -c Debug \
--results-directory TestResults \
-- --report-trx --report-trx-filename counter-e2e.trx \
--maximum-parallel-tests 1 --timeout 1h; then
exit 0
fi
if [ "$attempt" -lt "$E2E_RETRY_COUNT" ]; then
echo "Retrying Counter E2E in 20s..."
sleep 20
fi
attempt=$((attempt + 1))
done
echo "❌ Counter E2E failed after ${E2E_RETRY_COUNT} attempts"
exit 1
- name: Analyze Counter E2E results
if: always() && steps.check-e2e.outputs.Picea_Abies_Counter_Testing_E2E == 'true' && steps.counter-e2e.outcome != 'skipped'
run: |
echo "TRX discovery (Counter):"
find . -name "counter-e2e.trx" -type f | sed 's#^./##' || true
TRX_FILE=$(find . -name "counter-e2e.trx" -type f | head -1)
if [ -z "$TRX_FILE" ]; then
echo "❌ TRX file not found for Counter E2E"
exit 2
fi
python3 scripts/analyze_e2e_results.py "$TRX_FILE" --strict --min-pass-rate 1.0 --max-timeout-rate 0
# ── Templates E2E ─────────────────────────────────────────────
- name: Run Templates E2E tests
if: always() && steps.check-e2e.outputs.Picea_Abies_Templates_Testing_E2E == 'true'
id: templates-e2e
continue-on-error: true
run: |
mkdir -p TestResults
attempt=1
while [ "$attempt" -le "$E2E_RETRY_COUNT" ]; do
echo "Templates E2E attempt ${attempt}/${E2E_RETRY_COUNT}"
if dotnet test --project Picea.Abies.Templates.Testing.E2E/Picea.Abies.Templates.Testing.E2E.csproj \
--no-build -c Debug \
--results-directory TestResults \
-- --report-trx --report-trx-filename templates-e2e.trx \
--maximum-parallel-tests 1 --timeout 1h; then
exit 0
fi
if [ "$attempt" -lt "$E2E_RETRY_COUNT" ]; then
echo "Retrying Templates E2E in 20s..."
sleep 20
fi
attempt=$((attempt + 1))
done
echo "❌ Templates E2E failed after ${E2E_RETRY_COUNT} attempts"
exit 1
- name: Analyze Templates E2E results
if: always() && steps.check-e2e.outputs.Picea_Abies_Templates_Testing_E2E == 'true' && steps.templates-e2e.outcome != 'skipped'
run: |
echo "TRX discovery (Templates):"
find . -name "templates-e2e.trx" -type f | sed 's#^./##' || true
TRX_FILE=$(find . -name "templates-e2e.trx" -type f | head -1)
if [ -z "$TRX_FILE" ]; then
echo "❌ TRX file not found for Templates E2E"
exit 2
fi
python3 scripts/analyze_e2e_results.py "$TRX_FILE" --strict --min-pass-rate 1.0 --max-timeout-rate 0
# ── UI Demo E2E ───────────────────────────────────────────────
- name: Run UI Demo E2E tests
if: always() && steps.check-e2e.outputs.Picea_Abies_UI_Demo_Testing_E2E == 'true'
id: uidemo-e2e
continue-on-error: true
run: |
mkdir -p TestResults
attempt=1
while [ "$attempt" -le "$E2E_RETRY_COUNT" ]; do
echo "UI Demo E2E attempt ${attempt}/${E2E_RETRY_COUNT}"
if dotnet test --project Picea.Abies.UI.Demo.Testing.E2E/Picea.Abies.UI.Demo.Testing.E2E.csproj \
--no-build -c Debug \
--results-directory TestResults \
-- --report-trx --report-trx-filename uidemo-e2e.trx \
--maximum-parallel-tests 1 --timeout 1h; then
exit 0
fi
if [ "$attempt" -lt "$E2E_RETRY_COUNT" ]; then
echo "Retrying UI Demo E2E in 20s..."
sleep 20
fi
attempt=$((attempt + 1))
done
echo "❌ UI Demo E2E failed after ${E2E_RETRY_COUNT} attempts"
exit 1
- name: Analyze UI Demo E2E results
if: always() && steps.check-e2e.outputs.Picea_Abies_UI_Demo_Testing_E2E == 'true' && steps.uidemo-e2e.outcome != 'skipped'
run: |
echo "TRX discovery (UI Demo):"
find . -name "uidemo-e2e.trx" -type f | sed 's#^./##' || true
TRX_FILE=$(find . -name "uidemo-e2e.trx" -type f | head -1)
if [ -z "$TRX_FILE" ]; then
echo "❌ TRX file not found for UI Demo E2E"
exit 2
fi
python3 scripts/analyze_e2e_results.py "$TRX_FILE" --strict --min-pass-rate 1.0 --max-timeout-rate 0
# ── Artifacts & Summary ───────────────────────────────────────
- name: Upload test results
if: always()
uses: actions/upload-artifact@v6
with:
name: e2e-test-results
path: |
**/TestResults/**/*.trx