Skip to content

Commit 492ace6

Browse files
ci(e2e): surface failure detail (dot-runs.log + ::error:: annotations) inline in GH UI (closes #98) (#99)
1 parent 68f6417 commit 492ace6

3 files changed

Lines changed: 58 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"playground-cli": patch
3+
---
4+
5+
Failed E2E cells now surface forensic detail (CLI subprocess stdout/stderr from `dot-runs.log`, junit.xml failure messages, and `::error::` annotations at the top of the run page) directly in the GH Actions UI. Previously a triager had to download the artefact and untar it locally to see the real root cause. Closes #98.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Surface E2E failure detail
2+
description: |
3+
Print dot-runs.log + failed-testcase summary to the job log and emit
4+
::error:: annotations so triagers see the real root cause without
5+
downloading artefacts. Intended to run with `if: failure()` after a
6+
cell's test step.
7+
8+
runs:
9+
using: composite
10+
steps:
11+
- name: Dump dot-runs.log + failed testcases
12+
shell: bash
13+
run: |
14+
echo "::group::dot-runs.log (CLI subprocess stdout/stderr)"
15+
if [ -f e2e-reports/dot-runs.log ]; then
16+
cat e2e-reports/dot-runs.log
17+
else
18+
echo "(no dot-runs.log written — test failed before any dot subprocess ran, or the e2e-reports dir wasn't created)"
19+
fi
20+
echo "::endgroup::"
21+
22+
if [ -f e2e-reports/junit.xml ]; then
23+
if ! command -v xmlstarlet >/dev/null 2>&1; then
24+
sudo apt-get update -q
25+
sudo apt-get install -y -q xmlstarlet
26+
fi
27+
echo "::group::Failed testcases (from junit.xml)"
28+
xmlstarlet sel -t -m "//testcase[failure or error]" \
29+
-v "concat(@classname, ' › ', @name)" -o $'\n ' \
30+
-v "failure/@message | error/@message" -n e2e-reports/junit.xml || true
31+
echo "::endgroup::"
32+
33+
xmlstarlet sel -t -m "//testcase[failure or error]" \
34+
-v "concat('::error file=', @classname, '::', @name, ' — ')" \
35+
-v "failure/@message | error/@message" -n e2e-reports/junit.xml \
36+
| head -c 3000 || true
37+
fi

.github/workflows/e2e.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ jobs:
6565
DOT_TAG: ${{ steps.setup.outputs.tag }}
6666
DOT_TELEMETRY: "1"
6767

68+
- name: Surface failure detail
69+
if: failure()
70+
uses: ./.github/actions/surface-e2e-failure
71+
6872
- name: Upload forensic artefacts
6973
if: always()
7074
continue-on-error: true
@@ -115,6 +119,10 @@ jobs:
115119
DOT_TAG: ${{ steps.setup.outputs.tag }}
116120
DOT_TELEMETRY: "1"
117121

122+
- name: Surface failure detail
123+
if: failure()
124+
uses: ./.github/actions/surface-e2e-failure
125+
118126
- name: Upload forensic artefacts
119127
if: always()
120128
continue-on-error: true
@@ -161,6 +169,10 @@ jobs:
161169
DOT_TAG: ${{ steps.setup.outputs.tag }}
162170
DOT_TELEMETRY: "1"
163171

172+
- name: Surface failure detail
173+
if: failure()
174+
uses: ./.github/actions/surface-e2e-failure
175+
164176
- name: Upload forensic artefacts
165177
if: always()
166178
continue-on-error: true
@@ -217,6 +229,10 @@ jobs:
217229
DOT_TAG: ${{ steps.setup.outputs.tag }}
218230
DOT_TELEMETRY: "1"
219231

232+
- name: Surface failure detail
233+
if: failure()
234+
uses: ./.github/actions/surface-e2e-failure
235+
220236
- name: Upload forensic artefacts
221237
if: always()
222238
continue-on-error: true

0 commit comments

Comments
 (0)