Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using .simplecov does not generate coverage #454

Closed
DannyBen opened this issue Jan 27, 2016 · 5 comments
Closed

Using .simplecov does not generate coverage #454

DannyBen opened this issue Jan 27, 2016 · 5 comments

Comments

@DannyBen
Copy link

Hi,

I am trying to upgrade from simplecov 0.10 to the latest, and due to the new behavior where more files are considered for coverage in the new 0.11 release, I have to use add_filter to ignore some files.

So, since I am using both minitest and cucumber, I am trying to use the .simplecov file for configuration.

I have placed this snippet in it:

puts "Simplecov Config Here"
SimpleCov.start 'rails' do
  add_filter "/lib/runfile/"
end
SimpleCov.command_name "Minitest"

And left only require 'simplecov' in the test_helper and cucumber env file, but there is no coverage report generated unless I bring the config back into the test_helper itself.

I know the file is loaded, since running tests does show the result of the puts I put there, but no coverage is generated.

$ spring stop && bin/rake test
Simplecov Config Here
Running via Spring preloader in process 26181
Running via Spring preloader in process 26187
Run options: --seed 44430

# Running:

........

Finished in 1.438381s, 5.5618 runs/s, 11.8188 assertions/s.

8 runs, 17 assertions, 0 failures, 0 errors, 0 skips
Success

As a side note, perhaps rename the dot file from .simplecov to .simplecov.rb so it enjoys syntax highlighting without and such when editing.

EDIT:
I have tried using my own config file, and then use require_relative to include it in both testers, but then simplecov got a little nuts and considered blank lines and comments for the coverage (also with 0.10).

@tgraham
Copy link

tgraham commented Feb 9, 2016

I think 0.11.2's change to the coverage_path is causing this. Give 0.11.1 a try.

4253d56

Our Jenkins server recently started failing builds due to our rcov coverage output not being found and the only changes I could find are related to the bump from our previous 0.11.1 to the new 0.11.2.

Publishing rcov report...
file not found: /var/lib/jenkins/jobs/repo/workspace/coverage/rcov
rcov report directory wasn't found using the pattern 'coverage/rcov'.
Build step 'Publish Rcov report' changed build result to FAILURE
Build step 'Publish Rcov report' marked build as failure

I'm testing this theory right now by locking to 0.11.1, but our builds take 30+ minutes, so I'll report back after I know more.

@tgraham
Copy link

tgraham commented Feb 9, 2016

No luck switching back to 0.11.1, back to the drawing board.

@pcreux
Copy link

pcreux commented Feb 9, 2016

It might come from this change 1b5736f

I don't have much time to dig deeper into it though.

Rolling back to 0.9 for now... 😕

@pcreux
Copy link

pcreux commented Feb 9, 2016

My bad! I didn't have require: false magic in my Gemfile. 🙊

@PragTob
Copy link
Collaborator

PragTob commented Feb 4, 2017

As I read nothing more here and the last comment about this is a user error I'll close out - please ping and reopen if this problem persists for you.

Thank you all!

@PragTob PragTob closed this as completed Feb 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants