Questions tagged [simplecov]

Simplecov is a code coverage tool for Ruby 1.9+.

Simplecov is a code coverage tool for Ruby 1.9+ with a powerful configuration library and automatic merging of coverage across test suites.

https://github.com/colszowka/simplecov

https://www.ruby-toolbox.com/projects/simplecov

95 questions
3
votes
1 answer

What constitutes Ruby coverage measurement with simplecov gem

While running simplecov on Mac OSX, the resulting coverage makes little sense. If the following test is run: rails test test/models/channel_test.rb > 4 runs, 4 assertions, 0 failures, 0 errors, 0 skips > Coverage report generated for Minitest to…
Jerome
  • 5,583
  • 3
  • 33
  • 76
3
votes
2 answers

Using SimpleCov to display Cucumber code coverage

Does anyone have any experience using Cucumber and the code coverage tool SimpleCov? I'd added the following lines env.rb file so Cucumber will fire off SimpleCov- require 'simplecov' SimpleCov.start 'rails' SimpleCov.coverage_dir…
Will
  • 182
  • 2
  • 8
3
votes
1 answer

SonarQube not displaying test code coverage of Ruby on Rails project

I have a Ruby on Rails project that I want to display test coverage in SonarQube. The project is built with Jenkins which sends the results to SonarQube. Unit tests are run with rspec and code coverage is calculated with SimpleCov. SonarQube…
gomisha
  • 2,587
  • 3
  • 25
  • 33
3
votes
2 answers

Ruby code coverage without all the requires and method defintions?

When using a super simple simplecov setup like require 'simplecov' SimpleCov.start I get loads of "coverage" for files and code that were not really "executed" (in any sense that I would care about when looking at code coverage for a specific test)…
janpio
  • 10,645
  • 16
  • 64
  • 107
3
votes
1 answer

How to combine simplecov coverage/index.html files

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…
Uzair Nadeem
  • 745
  • 2
  • 8
  • 29
3
votes
0 answers

no coverage with SimpleCov, Rake and Test::Unit

In trying to generate code coverage statistics for a ruby repository I hit a wall. I use Rake to run my Test::Unit unit tests, but cannot get SimpleCov to return anything other than Coverage report generated for Unit Tests . 0.0 / 0.0 LOC…
3
votes
1 answer

Simplecov report ignores folders in /app directory

I use simplecov to measure coverage for my Rails 4.0.11 app. I use Ruby 2.0.0. I noticed that some subfolders of /app are ignored by simplecov and I can't figure out why. test_helper.rb: require 'simplecov' SimpleCov.start 'rails' ENV["RAILS_ENV"]…
2
votes
1 answer

SimpleCov showing 0% coverage in RubyMine but works fine elsewhere

I have a suspicion that this is a local system configuration issue, but I don't know exactly what I'm doing wrong. In my spec_helper.rb file, I have the following lines at the very beginning: require 'simplecov' SimpleCov.start 'rails' I can run…
jwir3
  • 6,019
  • 5
  • 47
  • 92
2
votes
0 answers

Rspec always exits with code 1 when simplecov is enabled

I have a Ruby on Rails 6.1 application I am testing with rspec 3.10, all tests passing and it exits with code 0. When I add Simplecov (using 0.21.2) the exit code is always 1. My simplecov configuration: # spec/rails_helper.rb require 'simplecov' if…
Nick M
  • 2,424
  • 5
  • 34
  • 57
2
votes
0 answers

SimpleCov reporting 100% coverage when merging result

I have a ruby project that contains many subprojects. Each subproject runs simplecov and the root project folder runs a rakefile to generate the total coverage report for all the subprojects. The problem is that it shows the correct coverage for the…
user3605351
  • 41
  • 1
  • 7
2
votes
1 answer

SImplecov - Incorrect test coverage for Grape API

I have a Rails 4.2 app with an API based on Grape. I started to write tests for it using Rpsec. My tests work great and test what I expected. But when I run rspec at terminal, Simplecov is not showing the correct coverage for the api files, as you…
Fabiano Arruda
  • 648
  • 7
  • 21
2
votes
2 answers

SimpleCov not showing rails files

I'm trying to use simplecov to monitor my test coverage however after having to roll back some changes to my project and reinstall simplecov it seems to have broken. It no longer tracks the models and controller ect, but instead covers the spec…
user2320239
  • 1,021
  • 2
  • 18
  • 43
2
votes
4 answers

Cannot find simplecov executable

My understanding is that RubyMine is set up to work with SimpleCov "out of the box". However, whenever I press the "test with coverage" button in RubyMine, I get the following: This is happening for all of my projects. I do have multiple versions…
jwir3
  • 6,019
  • 5
  • 47
  • 92
2
votes
1 answer

High code coverage rate with few tests for a Rails app using simplecov

We started to use the simplecov gem in order to calculate code coverage for a Ruby on Rails application. SimpleCov.start 'rails' Although we developed only a few test cases using Cucumber, the rate provided by simplecov is as high as 40%. How to…
2
votes
0 answers

Why isn't simplecov checking any of my rails views?

I installed simplecov on a new rails project, but it's not checking the view files. After reading some other posts on this issue I've updated my application as follows, but no dice. How do I get simplecov to test my views…
doub1ejack
  • 10,627
  • 20
  • 66
  • 125