forked from decidim/decidim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.simplecov
36 lines (30 loc) · 1.21 KB
/
.simplecov
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# frozen_string_literal: true
if ENV["SIMPLECOV"]
test_env = ENV.fetch("TEST_ENV_NUMBER", "")
test_env = "1" if test_env.empty?
SimpleCov.start do
# `ENGINE_ROOT` holds the name of the engine we're testing.
# This brings us to the main Decidim folder.
root File.expand_path("..", ENV.fetch("ENGINE_ROOT", nil))
# 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{^/decidim-[^/]*/lib/decidim/[^/]*/engine.rb}
add_filter %r{^/decidim-[^/]*/lib/decidim/[^/]*/admin-engine.rb}
add_filter %r{^/decidim-[^/]*/lib/decidim/[^/]*/component.rb}
add_filter %r{^/decidim-[^/]*/lib/decidim/[^/]*/participatory_space.rb}
end
SimpleCov.merge_timeout 1800
SimpleCov.coverage_dir "coverage/#{test_env}/"
if ENV["CI"]
require "simplecov-cobertura"
SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter
end
end