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 c71ee81 commit abbf0c6
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 130 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/term_customizer/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
4 changes: 0 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,3 @@ group :development do
gem "spring-watcher-listen", "~> 2.0"
gem "web-console", "~> 4.2"
end

group :test do
gem "codecov", require: false
end
Loading

0 comments on commit abbf0c6

Please sign in to comment.