Skip to content

fix(workers): keep results of each browser apart in multi-browser run-workers - #5759

Open
mirao wants to merge 2 commits into
codeceptjs:4.xfrom
mirao:fix/run-workers-multi-browser-reports-5411
Open

mirao wants to merge 2 commits into
codeceptjs:4.xfrom
mirao:fix/run-workers-multi-browser-reports-5411

Conversation

@mirao

@mirao mirao commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Fixes #5411

Problem

With run-workers <n> <run> --by suite and several browsers in multiple, reports lost results:

  • The same test has the same uid in every browser. The main process keys results by uid (Result.addTest(), _testStates), so one browser's results overwrote the other's. The Testomat.io HTML report and the JUnit XML each kept only one browser.
  • Every worker wrote its partial report.xml into its run folder, and workers of the same browser share that folder (e.g. output/dev_chromium1/). The file kept only the last worker's suites.

Fix

  • lib/workers.js: in a multi-browser run, the main process tags every incoming worker message with the run's output folder (outputDir) and adds the run name to the test uid (<uid>@dev_chromium1). Single-browser run-workers and run are not affected, because the tagging happens only for multi-browser runs.
  • lib/plugin/junitReporter.js: only the main process writes the report. When tests carry outputDir, it writes one report.xml per run folder, with all suites of that browser. The plugin's output option is ignored in that case, as documented.
  • lib/codecept.js: --last-failed strips the @run suffix before matching saved uids. Otherwise a multi-browser --last-failed run found no tests.

Result, same layout as run-multiple:

output/dev_chromium1/report.xml   # all suites, chromium only
output/dev_webkit1/report.xml     # all suites, webkit only

The Testomat.io HTML report keeps each browser's results as separate entries.

Tests

  • test/unit/junitReporter_test.js: one report per run folder, hook failures included, no combined report.
  • test/runner/run_workers_test.js:
    • run-workers 2 dev --by suite with 2 browsers × 2 suites writes a JUnit report per browser with all 4 tests.
    • The Testomat.io HTML report contains all 8 results (4 per browser).
  • test/runner/last_failed_test.js: run-workers 2 dev --last-failed re-runs the 6 failed tests.

All new tests fail without the fix. Unit tests: 898 passing. run_workers_test.js: 42 passing. last_failed_test.js: 14 passing.

Also verified on a real project: 3 suites × 2 browsers (Chromium + WebKit) × 2 workers.

🤖 Generated with Claude Code

Jaromir Obr and others added 2 commits October 21, 2026 14:14
…-workers (codeceptjs#5411)

In `run-workers <n> <run> --by suite` with several browsers, the same test
had the same uid in every browser, so the main process merged their results,
and every worker wrote its partial report.xml into the shared run folder.

- Tag every message from a multi-run worker with the run's output folder
  and make the test uid unique per run
- junitReporter: write reports only in the main process, one per run folder
- --last-failed: ignore the run suffix when matching saved uids

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…writes it

Newer @testomatio/reporter versions write the report to <output>/report and
ignore TESTOMATIO_HTML_REPORT_FOLDER.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

Mochawesome/Testomatio/junit reporter: run-workers: Running of test with --suite doesn't aggregate results from all suites per browser

1 participant