How to combine simplecov coverage/index.html files

1k Views Asked by At

I am using simplecov for rspec coverage. When I run RAILS_ENV=test rspec on my local, it generates a single coverage/index.html file but on CircleCI we are using 2 containers for rspec coverage. 2 separate containers generates two separate coverage/index.html files. i.e. one against each container. I want a single coverage/index.html on Circle CI. Is there a way to combine or merge both index files? or generates a single file against multiple containers?

enter image description here

1

There are 1 best solutions below

0
On

As explained in this excellent writeup, you want to merge .resultset.json files.

There will be implementation details of where the files are stored and what they're named, but in the end you should end up with a separate CI run step that merges the resultsets and generates the final HTML report by calling SimpleCov.collate.

See also SimpleCov's readme on merging results.