From d43315f738a415823c42e4b7d3df83c1d3aa9263 Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 6 Feb 2019 18:12:20 +0100 Subject: [PATCH] Output both the local simplecov html and the coveralls report Fixes #2066 --- CONTRIBUTING.md | 7 +------ test/test_helper.rb | 6 ++++++ 2 files changed, 7 insertions(+), 6 deletions(-) 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" -- 2.39.5