SimpleCov failed to recognize the test framework and/or suite used. Please specify manually using SimpleCov.command_name 'Unit Tests'.
Coverage report generated for Unknown Test Framework, minitest, rake minitest:all to /home/chris/Projects/shimpro/coverage. 5 / 5 LOC (100.0%) covered.
I am using minitest with rails
Test_helper.rb:
require 'simplecov'
SimpleCov.start 'rails'
require "minitest/reporters"
Minitest::Reporters.use!
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', FILE)
require 'rails/test_help'
class ActiveSupport::TestCase
fixtures :all
end
How do i fix this?
how does this help me?
Hi @cvandermeer - if you read the document @bf4 referenced, it lists a bunch of things we ask for from issue reporters so it makes it easier for us to help people quicker and have more of our spare time for other things. There is a reason it is shown above the form for creating new issues. Among others it asks for the simplecov and ruby versions to be listed, and for confirmation that the latest simplecov version is being used so we do not hunt down issues that have been solved long ago.
If you are asking open source contributors for support (and hence, some of their free time they could be spending with family, friends, working, whatever) but cannot possibly (even after an explicit nod pointing out the requirements) be bothered to spend the time to match said requirements for a good bug report that we can efficiently work with or even adding a sprinkle of formatting to your issue content, it makes us somewhat reluctant to set said time aside to look into your problem quickly.
That being said, if you take a look at the output simplecov gave you, at line 1 it says Please specify manually using SimpleCov.command_name 'Unit Tests'.. If you are inclined to learn more about this, you could then take a look at our README which has a whole section explaining the topic. If you think minitest integration in simplecov itself should be improved, please consider submitting a pull request that improves simplecov.
Thanks
Note: I saw this error message for a different reason in my app using Ruby on Rails, MiniTest, and Coveralls. First, here's the error I saw:
SimpleCov failed to recognize the test framework and/or suite used. Please specify manually using SimpleCov.command_name 'Unit Tests'.
In my case, the problem was that the way multiple formatters are expressed has changed as of SimpeCov version 0.9; you should specify ".formatters" as documented.
Here's the beginning of my Ruby on Rails test/test_helper.rb file (note how SimpleCov.formatters is set):
ENV['RAILS_ENV'] ||= 'test'
require 'simplecov'
SimpleCov.start 'rails' do
add_group 'Validators', 'app/validators'
add_filter '/config/'
add_filter '/lib/tasks'
add_filter '/test/'
add_filter '/vendor/'
end
require 'coveralls'
SimpleCov.formatters = [SimpleCov::Formatter::HTMLFormatter,
Coveralls::SimpleCov::Formatter]
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
I hope this helps. I answer this here, even though this is a closed issue, because on a search this is what Google points to.
Most helpful comment
Hi @cvandermeer - if you read the document @bf4 referenced, it lists a bunch of things we ask for from issue reporters so it makes it easier for us to help people quicker and have more of our spare time for other things. There is a reason it is shown above the form for creating new issues. Among others it asks for the simplecov and ruby versions to be listed, and for confirmation that the latest simplecov version is being used so we do not hunt down issues that have been solved long ago.
If you are asking open source contributors for support (and hence, some of their free time they could be spending with family, friends, working, whatever) but cannot possibly (even after an explicit nod pointing out the requirements) be bothered to spend the time to match said requirements for a good bug report that we can efficiently work with or even adding a sprinkle of formatting to your issue content, it makes us somewhat reluctant to set said time aside to look into your problem quickly.
That being said, if you take a look at the output simplecov gave you, at line 1 it says
Please specify manually using SimpleCov.command_name 'Unit Tests'.. If you are inclined to learn more about this, you could then take a look at our README which has a whole section explaining the topic. If you think minitest integration in simplecov itself should be improved, please consider submitting a pull request that improves simplecov.Thanks