Skip to content

Commit

Permalink
update(simplecov docs): How to merge SimpleCov reports from parallel …
Browse files Browse the repository at this point in the history
…CI nodes
  • Loading branch information
ArturT committed Jun 6, 2024
1 parent 4e3ae55 commit 164b812
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions docusaurus/docs/ruby/simplecov.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ end

This is needed to avoid conflicts between code coverage reports generated by parallel CI nodes.

If the local drive is common between parallel nodes on your CI, `simplecov` will generate a single report at `coverage/index.html` with merged data. Otherwise, you can refer to [How to merge CodeClimate reports for parallel jobs (CI nodes)](https://docs.knapsackpro.com/2019/how-to-merge-codeclimate-reports-for-parallel-jobs-ci-nodes) or [How to merge SimpleCov results with parallel Rails specs on Semaphore CI](https://docs.knapsackpro.com/2020/how-to-merge-simplecov-results-with-parallel-rails-specs).

Please [see this if you use CodeClimate](code-climate.md#rspec).

## Minitest
Expand Down Expand Up @@ -86,3 +84,20 @@ Please [see this if you use CodeClimate](code-climate.md#minitest).

</details>

## How to merge SimpleCov reports from parallel CI nodes

### Isolated parallel nodes with their own disk

Please check SimpleCov docs for [merging test runs under different execution environments](https://github.com/simplecov-ruby/simplecov?tab=readme-ov-file#merging-test-runs-under-different-execution-environments).

You could create [a rake task to merge SimpleCov reports](https://github.com/simplecov-ruby/simplecov/issues/986#issuecomment-1164999210).

Please refer to your CI provider documentation to learn how to get files from parallel nodes and put them in the same location so that you can merge them.
You can also look at these examples:

* [How to merge SimpleCov results with parallel Rails specs on Semaphore CI](https://docs.knapsackpro.com/2020/how-to-merge-simplecov-results-with-parallel-rails-specs)
* [How to merge CodeClimate reports for parallel jobs (CI nodes)](https://docs.knapsackpro.com/2019/how-to-merge-codeclimate-reports-for-parallel-jobs-ci-nodes)

### Shared disk between parallel nodes

SimpleCov generates a single report at `coverage/index.html` with merged data if a local drive is shared between parallel nodes. This is the case when you use Jenkins and the disk is shared between parallel nodes.

0 comments on commit 164b812

Please sign in to comment.