Repository navigation
docs: explain how to combine coverage from parallel Cypress Cloud runs - #1006
Merged
Merged
Conversation
Each machine in a parallel run writes its own .nyc_output/out.json, and neither the plugin nor Cypress Cloud combines them. Document the CI pattern: upload each machine's file as an artifact under a unique name, then run `nyc report` over all of them in a final job. Includes a GitHub Actions example and notes on absolute source paths and coverage thresholds. Closes #853 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WUv8r1p9MrmJVuBc9LqSv6
|
🎉 This PR is included in version 4.1.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Additional details
When specs run in parallel across several machines, for example with Cypress Cloud's
--record --parallel, each machine writes its own.nyc_output/out.jsonand builds a report from only that file (lib/task.ts). Neither the plugin nor Cypress Cloud combines those files. The README only hinted at this through external example apps, so anyone running in parallel just saw partial coverage and had no clear next step.This PR adds a Parallel runs and Cypress Cloud section to
README.md, just before "TypeScript users". It covers:out.jsonas a CI artifact under a unique name. A final job downloads them all into.nyc_outputand runsnpx nyc report, which merges every JSON file in that folder.checkCoverageoff on the test machines and runnyc report --check-coveragein the report job. Otherwise each machine checks only its share of the coverage and can fail.cypress-example-conduit-app, which does the same thing on a different CI provider.This is a docs-only change. There are no code or runtime changes.
Steps to test
README.md.out.jsonfiles with different names (for exampleout-1.jsonandout-2.json) in one folder. Runnpx nyc report --temp-dir <folder> --reporter=text-summaryand you should get the combined coverage. When I tried this, each file alone showed 50% function coverage and the merged folder showed 100%.npm run build,npm testandnpm run format:checkall pass. The new links innpm run check:markdownresolve: the Cloud parallelization docs page and the#enforce-coverage-thresholdsand#instrument-backend-codeanchors.The GitHub Actions example itself hasn't been run end to end, since that needs a Cypress Cloud record key. Please take a close look at the
actions/download-artifactsettings (patternandmerge-multiple).How has the user experience changed?
No change. The plugin behaves the same. The README now documents how to get combined coverage from parallel runs.
Generated by Claude Code
Note
Low Risk
README-only documentation with no code or runtime behavior changes.
Overview
Adds a Parallel runs and Cypress Cloud section to
README.md(before TypeScript users) that explains why parallelcypress run --record --paralleljobs each produce partial coverage and how to merge them in CI.The doc describes uploading each machine’s
.nyc_output/out.jsonas a uniquely named artifact, then a follow-up job that downloads all JSON files into.nyc_outputand runsnpx nyc reportto merge them. It includes a three-container GitHub Actions example (upload-artifact/download-artifactwithmerge-multiple), plus notes on absolute paths, movingcheckCoverageenforcement to the report job, backend coverage in merged output, and a link to cypress-example-conduit-app.Docs-only; no plugin or runtime changes.
Reviewed by Cursor Bugbot for commit 5c4acca. Bugbot is set up for automated code reviews on this repo. Configure here.