-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix codecov/simplecov configurations
- Loading branch information
1 parent
5e9a64b
commit 5ee39ea
Showing
4 changed files
with
27 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters