-
-
Notifications
You must be signed in to change notification settings - Fork 265
/
.simplecov
33 lines (29 loc) · 985 Bytes
/
.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, it just works, coverage is turned on:
# bundle exec rspec spec
# On Local, all output formats:
# 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 "test"
add_filter "lib/oauth/version.rb"
track_files "**/*.rb"
if ALL_FORMATTERS
command_name "#{ENV.fetch("GITHUB_WORKFLOW",
nil)} Job #{ENV.fetch("GITHUB_RUN_ID", nil)}:#{ENV.fetch("GITHUB_RUN_NUMBER", nil)}"
else
formatter SimpleCov::Formatter::HTMLFormatter
end
minimum_coverage(65)
end
else
puts "Not running coverage on #{RUBY_ENGINE} #{RUBY_VERSION}"
end