feat: unique test results per run (--run-name) - #3
Open
stanleykim-ux wants to merge 1 commit into
Open
Conversation
Every run now writes into test-results/<run> (Playwright output plus appwright's video store) and playwright-report/<run>, so concurrent runs on one machine no longer clobber each other. The name comes from the appwright CLI's new --run-name flag or APPWRIGHT_RUN_NAME, and defaults to <project>-<YYYYMMDD>-<HHmmss>-<rand4>. The config re-reads the name from the environment because Playwright evaluates it again in every worker. The video store moves out of playwright-report/, which the html reporter deletes before it copies attachments. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
stanleykim-ux
added this pull request to stack #4
September 10, 2026 20:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #2 (
feat/parallel-local-devices). Review only the last commit.Why
Two appwright runs on one machine (for example
yarn test:iosandyarn test:androidside by side, which #2 makes practical) clobber each other's output: Playwright wipestest-results/at the start of every run, the html reporter deletesplaywright-report/before rebuilding it, and appwright's own video / worker-info store was hardcoded toplaywright-report/data/videos-store(there was a TODO inworkerInfo.tsasking for exactly this fix).What
Every run writes into its own folders:
appwright test --run-name <name>names the run. The flag is stripped by the appwright CLI (Playwright rejects unknown options) and passed down asAPPWRIGHT_RUN_NAME, which can also be set directly (CI).<project>-<YYYYMMDD>-<HHmmss>-<4 random chars>, e.g.android-20260910-153915-k3i4. Sortable and tells you which platform at a glance.[A-Za-z0-9._+-]so they are always a safe path segment.outputDir/ htmloutputFolderin the consumer config is kept as the base; the run name is nested under it.tulip-player-mobile/e2e) needs no change:yarn test:android --run-name smokepasses straight through.Notes for reviewers
defineConfigcannot generate a fresh name;resolveRunName()readsAPPWRIGHT_RUN_NAMEand only generates (and stores) one when it is unset. That also makes the directnpx playwright test -c appwright.config.tspath work.playwright-report/data/videos-storetotest-results/<run>/videos-store. The html reporter removes its whole output folder inonEndbefore it reads attachment files, so anything stored underplaywright-report/was lost at report time. Playwright clearsoutputDirat run start, so the new location is fresh per run.--last-failedreads.last-run.jsonfrom the run's folder, so it needs the same--run-nameagain. Documented.rm -rf test-results playwright-report.Verification
npm run build,npm test(75 tests, 38 new covering name generation/sanitizing, flag parsing, reporter mapping, CLI invocation).dist/:appwright test --project android --run-name smoke→test-results/smoke/{.last-run.json,videos-store/worker-info-0.json},playwright-report/smoke/index.html.appwright test --project android(no flag) →android-20260910-153915-k3i4.npx playwright test --config appwright.config.ts --project android(bypassing the appwright CLI) →android-20260910-153922-r2em.🤖 Generated with Claude Code