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

Is it possible to disable the "Coverage report generated..." message? #992

Open
dogweather opened this issue May 31, 2021 · 2 comments
Open

Comments

@dogweather
Copy link

I couldn't find a list of config options.

This long line of text is unnecessary noise for my configuration.

@dillonhafer
Copy link

I disabled this with an at_exit block

SimpleCov.at_exit do
  original_file_descriptor = $stdout
  $stdout.reopen("/dev/null")
  SimpleCov.result.format!
  $stdout.reopen(original_file_descriptor)
end

@duffyjp
Copy link

duffyjp commented Aug 29, 2022

@dillonhafer that trick works great. I ended up adding a simplecov_helper.rb file and requiring it from my spec_helper.rb to keep things tidy. With parallel_tests on a 10 core system my stdout is much cleaner.


spec/spec_helper.rb

-require 'simplecov'
-SimpleCov.start
+require 'simplecov_helper'

spec/simplecov_helper.rb

require 'simplecov'
SimpleCov.start

# Don't print the "Coverage report generated for..." messages
# https://github.com/simplecov-ruby/simplecov/issues/992
SimpleCov.at_exit do
  original_file_descriptor = $stdout
  $stdout.reopen("/dev/null")
  SimpleCov.result.format!
  $stdout.reopen(original_file_descriptor)
end

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

3 participants