Skip to content

Commit

Permalink
Fix codecov/simplecov configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
sinaeftekhar committed Aug 10, 2023
1 parent 30652f0 commit 2829a92
Show file tree
Hide file tree
Showing 4 changed files with 241 additions and 231 deletions.
34 changes: 27 additions & 7 deletions .simplecov
Original file line number Diff line number Diff line change
@@ -1,12 +1,32 @@
# frozen_string_literal: true

SimpleCov.start do
root ENV.fetch("ENGINE_ROOT", nil)
if ENV["SIMPLECOV"]
SimpleCov.start do
# `ENGINE_ROOT` holds the name of the engine we are testing.
# This brings us to the main Decidim folder.
root ENV.fetch("ENGINE_ROOT", nil)

add_filter "lib/decidim/suomifi/version.rb"
add_filter "/spec"
end
# We make sure we track all Ruby files, to avoid skipping unrequired files
# We need to include the `../` section, otherwise it only tracks files from the
# `ENGINE_ROOT` folder for some reason.
track_files "**/*.rb"

# We ignore some of the files because they are never tested
add_filter "/config/"
add_filter "/db/"
add_filter "/vendor/"
add_filter "/spec/"
add_filter "/test/"
add_filter %r{^/lib/decidim/[^/]*/engine.rb}
add_filter %r{^/lib/decidim/[^/]*/admin_engine.rb}
add_filter %r{^/lib/decidim/[^/]*/component.rb}
add_filter %r{^/lib/decidim/[^/]*/participatory_space.rb}
end

SimpleCov.command_name ENV.fetch("COMMAND_NAME", nil) || File.basename(Dir.pwd)
SimpleCov.merge_timeout 1800

SimpleCov.merge_timeout 1800
if ENV["CI"]
require "simplecov-cobertura"
SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter
end
end
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,5 @@ group :development do
end

group :test do
gem "codecov", require: false
gem "xmlenc", "~> 0.8.0"
end
Loading

0 comments on commit 2829a92

Please sign in to comment.