Skip to content

Upload traces of failed e2e tests as a CI artifact - #1932

Closed
joepio wants to merge 2 commits into
developfrom
claude/e2e-trace-artifacts
Closed

joepio wants to merge 2 commits into
developfrom
claude/e2e-trace-artifacts

Conversation

@joepio

@joepio joepio commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Requested by Joep

Before: a failed e2e test on Mancave left only its assertion message and a 20k-character log tail. Playwright records traces with retain-on-failure, but the only way off the runner was the netlify report deploy, and this repo has no NETLIFY_TOKEN secret. So every run logged "no report deployed", and the traces were discarded with the Dagger container. On 29–30 September, batch #1915 failed several runs on tests where a cold reload rendered a blank page. None of them reproduced locally, and without a trace they couldn't be diagnosed.

After: failed e2e runs upload their traces, screenshots and error-context.md as the e2e-test-results-<attempt> artifact (14 days, free on this public repo).

How:

  • ci and endToEnd take --results-key (the workflow passes <run id>-<attempt>). When shards fail, their test-results are copied into the Dagger cache volume e2e-test-results-v1 under that key. Entries older than 7 days are pruned on each save.
  • A new e2e-test-results --results-key … function returns that folder as a Directory. main-ci.yml calls it in an if: failure() step with export --path e2e-test-results, then actions/upload-artifact picks it up.
  • Why not simpler: the first version called Directory.export inside the module. In batch run 36713938110 that "succeeded" but wrote into the function's own sandbox, not onto the runner, so nothing was uploaded. The ci call fails, so it can't return the directory itself, and its shard containers carry a per-call nonce, so a second call can't reuse them from cache. The cache volume is what both calls share.
  • The collect step is continue-on-error, so it can never hide the real failure.

Checked: the workflow parses, and pnpm --dir .dagger test passes 4/4 (the regression test now pins the forwarded resultsKey). tsc in .dagger has the same 2 errors as develop, from the SDK that is only generated in CI. The artifact itself proves out on the next failing run; this goes into the next batch so that happens tonight.

@joepio

joepio commented Sep 30, 2026

Copy link
Copy Markdown
Member Author

Trekmeester: included in batch #1915 (run 36713938110), so it's tested there and lands with it.

joepio added a commit that referenced this pull request Sep 30, 2026
@joepio

joepio commented Sep 30, 2026

Copy link
Copy Markdown
Member Author

Trekmeester: this doesn't work yet. Batch run 36713938110 showed export directory /app/e2e/test-results to host e2e-test-results/shard-2 DONE, but upload-artifact found nothing and the folder exists nowhere on Mancave. Inside a Dagger module, Directory.export writes into the function's own sandbox. Next approach: a separate function that returns the failed shards' test-results as a Directory, which the workflow exports with dagger call ... export --path in an if: failure() step. Taken out of batch #1915 until then.

@joepio
joepio marked this pull request as draft September 30, 2026 13:24
@joepio

joepio commented Sep 30, 2026

Copy link
Copy Markdown
Member Author

Trekmeester: included in batch #1947 (run 36781515104; #1915 had been merged without it). It lands when that run is green; if this PR breaks something there, I take it out and say why here.

joepio added a commit that referenced this pull request Oct 1, 2026
… e2e traces, Android menus, demo tooling, docs (#1947)

Includes #1884, #1930, #1940, #1888, #1933, #1882, #1834, #1631, #1932, #1945 and the ForkBar part of #1530.

joepio commented Oct 1, 2026

Copy link
Copy Markdown
Member Author

Merged into develop through batch #1947 (squash 1f892aa); this head was verified as part of it. Closing.


Generated by Claude Code

@joepio joepio closed this Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant