Skip to content

Commit

Permalink
Add cobertura and junit stuff for codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
NuckChorris committed Dec 26, 2024
1 parent 202d2fd commit 4f5ec8c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -896,6 +899,7 @@ DEPENDENCIES
sidekiq-debounce
sidekiq-scheduler
simplecov
simplecov-cobertura
sinatra
sitemap_generator
spring
Expand Down
10 changes: 10 additions & 0 deletions spec/support/coverage.rb
Original file line number Diff line number Diff line change
@@ -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/'
Expand Down

0 comments on commit 4f5ec8c

Please sign in to comment.