Commit 9306437b authored by Fabio Huser's avatar Fabio Huser Committed by Roger Meier

Add cobertura SimpleCov coverage reporter to all rspec tests

parent 7b3cef62
...@@ -371,6 +371,7 @@ group :development, :test do ...@@ -371,6 +371,7 @@ group :development, :test do
gem 'scss_lint', '~> 0.56.0', require: false gem 'scss_lint', '~> 0.56.0', require: false
gem 'haml_lint', '~> 0.34.0', require: false gem 'haml_lint', '~> 0.34.0', require: false
gem 'simplecov', '~> 0.18.5', require: false gem 'simplecov', '~> 0.18.5', require: false
gem 'simplecov-cobertura', '~> 1.3.1', require: false
gem 'bundler-audit', '~> 0.6.1', require: false gem 'bundler-audit', '~> 0.6.1', require: false
gem 'benchmark-ips', '~> 2.3.0', require: false gem 'benchmark-ips', '~> 2.3.0', require: false
......
...@@ -1021,6 +1021,8 @@ GEM ...@@ -1021,6 +1021,8 @@ GEM
simplecov (0.18.5) simplecov (0.18.5)
docile (~> 1.1) docile (~> 1.1)
simplecov-html (~> 0.11) simplecov-html (~> 0.11)
simplecov-cobertura (1.3.1)
simplecov (~> 0.8)
simplecov-html (0.12.2) simplecov-html (0.12.2)
sixarm_ruby_unaccent (1.2.0) sixarm_ruby_unaccent (1.2.0)
slack-messenger (2.3.3) slack-messenger (2.3.3)
...@@ -1382,6 +1384,7 @@ DEPENDENCIES ...@@ -1382,6 +1384,7 @@ DEPENDENCIES
sidekiq-cron (~> 1.0) sidekiq-cron (~> 1.0)
simple_po_parser (~> 1.1.2) simple_po_parser (~> 1.1.2)
simplecov (~> 0.18.5) simplecov (~> 0.18.5)
simplecov-cobertura (~> 1.3.1)
slack-messenger (~> 2.3.3) slack-messenger (~> 2.3.3)
snowplow-tracker (~> 0.6.1) snowplow-tracker (~> 0.6.1)
spring (~> 2.0.0) spring (~> 2.0.0)
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
require_relative '../spec/simplecov_env' require_relative '../spec/simplecov_env'
SimpleCovEnv.configure_profile SimpleCovEnv.configure_profile
SimpleCovEnv.configure_formatter
module SimpleCov module SimpleCov
module ResultMerger module ResultMerger
......
# frozen_string_literal: true # frozen_string_literal: true
require 'simplecov' require 'simplecov'
require 'simplecov-cobertura'
require 'active_support/core_ext/numeric/time' require 'active_support/core_ext/numeric/time'
require_relative '../lib/gitlab/utils' require_relative '../lib/gitlab/utils'
...@@ -12,10 +13,19 @@ module SimpleCovEnv ...@@ -12,10 +13,19 @@ module SimpleCovEnv
configure_profile configure_profile
configure_job configure_job
configure_formatter
SimpleCov.start SimpleCov.start
end end
def configure_formatter
SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new([
SimpleCov::Formatter::SimpleFormatter,
SimpleCov::Formatter::HTMLFormatter,
SimpleCov::Formatter::CoberturaFormatter
])
end
def configure_job def configure_job
SimpleCov.configure do SimpleCov.configure do
if ENV['CI_JOB_NAME'] if ENV['CI_JOB_NAME']
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment