You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As it seems, rails-minitest and simplecov don't work nicely together yet, regardless of wether you use spec or unit test style (#235). When running the test suite via rake, the reported coverage seems to be wrong.
I'd like to help identify the problem and fix this.
Here's what I experienced and how my setup looks like (nTraum/tf2movies, I'm using spec style).
With test_helper.rb requiring simplecov and starting SimpleCov with the rails profile at the very top.
Running the test suite
minitest-rails offers the following commands:
$ rake -D minitest
rake minitest
Run default tests
rake minitest:all
Run all tests
rake minitest:all:quick
Run all tests, ungrouped for quicker execution
rake minitest:controllers
Runs tests under test/controllers
rake minitest:integration
Runs tests under test/integration
rake minitest:models
Runs tests under test/models
Observations
rake minitest:all:quick, which runs all tests within one rake task works as expected, reported coverage is correct.
rake minitest:all, which seems to invoke separate rake tasks for each dir under test (correct me if I'm wrong) overrides previous coverage reports.
rake minitest:models, which only runs tests under test/models reports test coverage correctly for models. SimpleCov prints the following line though:
Coverage report generated for Integration Tests, Unit Tests to /home/ntraum/coding/tf2movies/coverage. 202 / 214 LOC (94.39%) covered.
Integration tests were not executed though.
rake minitest:controllers, s.a.
That's all I got.
The text was updated successfully, but these errors were encountered:
Both repos use the default Rakefile. I'd recommend requiring SimpleCov at the very top, and either starting SimpleCov there, or using a .simplecov file
Hi,
As it seems,
rails-minitest
andsimplecov
don't work nicely together yet, regardless of wether you use spec or unit test style (#235). When running the test suite viarake
, the reported coverage seems to be wrong.I'd like to help identify the problem and fix this.
Here's what I experienced and how my setup looks like (nTraum/tf2movies, I'm using spec style).
Test directory structure
Vanilla
minitest-rails
:With
test_helper.rb
requiringsimplecov
and starting SimpleCov with therails
profile at the very top.Running the test suite
minitest-rails
offers the following commands:$ rake -D minitest rake minitest Run default tests rake minitest:all Run all tests rake minitest:all:quick Run all tests, ungrouped for quicker execution rake minitest:controllers Runs tests under test/controllers rake minitest:integration Runs tests under test/integration rake minitest:models Runs tests under test/models
Observations
rake minitest:all:quick
, which runs all tests within one rake task works as expected, reported coverage is correct.rake minitest:all
, which seems to invoke separate rake tasks for each dir undertest
(correct me if I'm wrong) overrides previous coverage reports.rake minitest:models
, which only runs tests undertest/models
reports test coverage correctly for models. SimpleCov prints the following line though:Integration tests were not executed though.
rake minitest:controllers
, s.a.That's all I got.
The text was updated successfully, but these errors were encountered: