bsiddiqui
bsiddiqui

Reputation: 1926

Coveralls coverage not matching SimpleCov

I'm using the 'simplecov' and 'coveralls' ruby gems but the report that is generated by simplecov doesn't match the report generated by coveralls.

I've found that coveralls is not ignoring code that's wrapped in

# :nocov:

Here is my configuration

require "simplecov"
require "coveralls"

SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
  SimpleCov::Formatter::HTMLFormatter,
  Coveralls::SimpleCov::Formatter
]
SimpleCov.start

Is there something else I need to be doing to get coveralls to ignore code?

Upvotes: 4

Views: 985

Answers (1)

RedFred
RedFred

Reputation: 1039

As a first step, I'd try the following:

  1. create a .simplecov file on your project root folder.
  2. copy your simplecov configuration in .simplecov.
  3. Remove the Coveralls formatter from your config. So .simplecov now looks like this:

    SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter

    SimpleCov.start

While test_helper.rb looks like this:

require "simplecov"
require "coveralls"
  1. Try testing again and see if the problem is fixed

Upvotes: 1

Related Questions