From 4f5ec8c5ce6bb01806da9046ee52fdce4c725911 Mon Sep 17 00:00:00 2001 From: Emma Lejeck Date: Wed, 25 Dec 2024 22:08:10 -0800 Subject: [PATCH] Add cobertura and junit stuff for codecov --- Gemfile | 5 +++++ Gemfile.lock | 4 ++++ spec/support/coverage.rb | 10 ++++++++++ 3 files changed, 19 insertions(+) diff --git a/Gemfile b/Gemfile index eca7ed8ac3..141def024f 100644 --- a/Gemfile +++ b/Gemfile @@ -180,6 +180,11 @@ group :test do gem 'simplecov' # Local coverage end +group :ci do + gem 'simplecov-cobertura' + gem 'rspec_junit_formatter' +end + group :production, :staging do gem 'puma_worker_killer' end diff --git a/Gemfile.lock b/Gemfile.lock index a6bb20e6fe..ada8358743 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -711,6 +711,9 @@ GEM docile (~> 1.1) simplecov-html (~> 0.11) simplecov_json_formatter (~> 0.1) + simplecov-cobertura (2.1.0) + rexml + simplecov (~> 0.19) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) sinatra (3.0.6) @@ -896,6 +899,7 @@ DEPENDENCIES sidekiq-debounce sidekiq-scheduler simplecov + simplecov-cobertura sinatra sitemap_generator spring diff --git a/spec/support/coverage.rb b/spec/support/coverage.rb index f988634706..9b45a0be65 100644 --- a/spec/support/coverage.rb +++ b/spec/support/coverage.rb @@ -1,5 +1,15 @@ +# frozen_string_literal: true + require 'simplecov' +case ENV.fetch('SIMPLECOV_REPORTER', nil) +when 'cobertura' + require 'simplecov-cobertura' + SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter +else + SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter +end + SimpleCov.start do add_filter '/spec/' add_filter '/config/'