From: Tom Hughes Date: Wed, 6 Mar 2019 17:23:46 +0000 (+0000) Subject: Merge remote-tracking branch 'upstream/pull/2167' X-Git-Tag: live~2782 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/be0e33862fedbf02e52a9e126cac31dfb5775b43?hp=bd79c197cc8919e566f4563aafe1f01d9cfc94bc Merge remote-tracking branch 'upstream/pull/2167' --- 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..e66d782ff 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,6 +1,21 @@ require "coveralls" Coveralls.wear!("rails") +# Override the simplecov output message, since it is mostly unwanted noise +module SimpleCov + module Formatter + class HTMLFormatter + def output_message(_result); end + end + end +end + +# 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"