-
-
Notifications
You must be signed in to change notification settings - Fork 194
/
.simplecov
33 lines (29 loc) · 1.06 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
# frozen_string_literal: true
# To get coverage
# On Local, default (HTML) output coverage is turned on with Ruby 2.6+:
# bundle exec rspec spec
# On Local, all output formats with Ruby 2.6+:
# COVER_ALL=true bundle exec rspec spec
#
# On CI, all output formats, the ENV variables CI is always set,
# and COVER_ALL, and CI_CODECOV, are set in the coverage.yml workflow only,
# so coverage only runs in that workflow, and outputs all formats.
#
if RUN_COVERAGE
SimpleCov.start do
enable_coverage :branch
primary_coverage :branch
add_filter 'spec'
# Why exclude version.rb? See: https://github.com/simplecov-ruby/simplecov/issues/557#issuecomment-410105995
add_filter 'lib/dynamoid/version.rb'
track_files '**/*.rb'
if ALL_FORMATTERS
command_name "#{ENV.fetch('GITHUB_WORKFLOW')} Job #{ENV.fetch('GITHUB_RUN_ID')}:#{ENV.fetch('GITHUB_RUN_NUMBER')}"
else
formatter SimpleCov::Formatter::HTMLFormatter
end
minimum_coverage(line: 90, branch: 89)
end
else
puts "Not running coverage on #{RUBY_VERSION}-#{RUBY_ENGINE}"
end