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 5e9a64b commit 5ee39ea
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 21 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/apiauth/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 @@ -34,7 +34,3 @@ group :development do
gem "spring-watcher-listen", "~> 2.0"
gem "web-console", "~> 3.5"
end

group :test do
gem "codecov", require: false
end
3 changes: 0 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ GEM
chef-utils (18.2.7)
concurrent-ruby
childprocess (4.1.0)
codecov (0.6.0)
simplecov (>= 0.15, < 0.22)
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
coffee-rails (5.0.0)
Expand Down Expand Up @@ -820,7 +818,6 @@ PLATFORMS
DEPENDENCIES
bootsnap (~> 1.4)
byebug (~> 11.0)
codecov
decidim (~> 0.27.0)
decidim-apiauth!
decidim-dev (~> 0.27.0)
Expand Down
7 changes: 0 additions & 7 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@

require "decidim/dev"

require "simplecov"
SimpleCov.start "rails"
if ENV["CODECOV"]
require "codecov"
SimpleCov.formatter = SimpleCov::Formatter::Codecov
end

ENV["ENGINE_ROOT"] = File.dirname(__dir__)

Decidim::Dev.dummy_app_path =
Expand Down

0 comments on commit 5ee39ea

Please sign in to comment.