简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM