Simplecov not showing correct coverage in Rails 6

843 Views Asked by At

Simplecov doesn't seem to work with Rails 5 or 6 with the default settings, with the report showing 0% covered.

What is the fix?

1

There are 1 best solutions below

1
Carson Cole On

It appears that Simplecov doesn't merge different test results when you run test on multiple processors.

The simplest solution that did the job was to comment out the running of test on more than one processor. This will result in tests running a lot slower, however, you don't need Simplecov results on every test run, so you can uncomment back to multiple processors for all other times you want to run tests.

test_helper.rb

# parallelize(workers: :number_of_processors)