From: Andy Allan Date: Wed, 6 Feb 2019 17:12:20 +0000 (+0100) Subject: Output both the local simplecov html and the coveralls report X-Git-Tag: live~3254^2~1 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/d43315f738a415823c42e4b7d3df83c1d3aa9263?ds=sidebyside;hp=-c Output both the local simplecov html and the coveralls report Fixes #2066 --- d43315f738a415823c42e4b7d3df83c1d3aa9263 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index acb780746..43b74224f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -35,12 +35,7 @@ You can run the existing test suite with: bundle exec rake test ``` -You can generate test coverage stats with: - -``` -sudo gem install rcov -rcov -x gems test/*/*.rb -``` +You can view test coverage statistics by browsing the `coverage` directory. The tests are automatically run on Pull Requests and other commits with the results shown on [Travis CI](https://travis-ci.org/openstreetmap/openstreetmap-website). diff --git a/test/test_helper.rb b/test/test_helper.rb index 747edf016..d44fcd253 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,6 +1,12 @@ require "coveralls" Coveralls.wear!("rails") +# Output both the local simplecov html and the coveralls report +SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new( + [SimpleCov::Formatter::HTMLFormatter, + Coveralls::SimpleCov::Formatter] +) + ENV["RAILS_ENV"] = "test" require_relative "../config/environment" require "rails/test_help"