Skip to content

Commit

Permalink
Merge pull request #3339 from dependabot/brrygrdn/coverage-reports-ar…
Browse files Browse the repository at this point in the history
…e-optional

Make code coverage optional via an envvar
  • Loading branch information
brrygrdn authored Mar 24, 2021
2 parents bb9cc2d + dd1248b commit 11e5cbe
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 21 deletions.
32 changes: 17 additions & 15 deletions common/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,23 @@
require "dependabot/dependency_file"
require_relative "dummy_package_manager/dummy"

SimpleCov::Formatter::Console.output_style = "block"
SimpleCov.formatter = if ENV["CI"]
SimpleCov::Formatter::Console
else
SimpleCov::Formatter::HTMLFormatter
end

SimpleCov.start do
add_filter "/spec/"

enable_coverage :branch
minimum_coverage line: 80, branch: 70
# TODO: Enable minimum coverage per file once outliers have been increased
# minimum_coverage_by_file 80
refuse_coverage_drop
if ENV["COVERAGE"]
SimpleCov::Formatter::Console.output_style = "block"
SimpleCov.formatter = if ENV["CI"]
SimpleCov::Formatter::Console
else
SimpleCov::Formatter::HTMLFormatter
end

SimpleCov.start do
add_filter "/spec/"

enable_coverage :branch
minimum_coverage line: 80, branch: 70
# TODO: Enable minimum coverage per file once outliers have been increased
# minimum_coverage_by_file 80
refuse_coverage_drop
end
end

RSpec.configure do |config|
Expand Down
6 changes: 4 additions & 2 deletions go_modules/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ def require_common_spec(path)

require "#{common_dir}/spec/spec_helper.rb"

# TODO: Bring branch coverage up
SimpleCov.minimum_coverage line: 80, branch: 65
if ENV["COVERAGE"]
# TODO: Bring branch coverage up
SimpleCov.minimum_coverage line: 80, branch: 65
end
6 changes: 4 additions & 2 deletions nuget/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ def require_common_spec(path)

require "#{common_dir}/spec/spec_helper.rb"

# TODO: Bring branch coverage up
SimpleCov.minimum_coverage line: 80, branch: 65
if ENV["COVERAGE"]
# TODO: Bring branch coverage up
SimpleCov.minimum_coverage line: 80, branch: 65
end
6 changes: 4 additions & 2 deletions terraform/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ def require_common_spec(path)

require "#{common_dir}/spec/spec_helper.rb"

# TODO: Bring branch coverage up
SimpleCov.minimum_coverage line: 80, branch: 55
if ENV["COVERAGE"]
# TODO: Bring branch coverage up
SimpleCov.minimum_coverage line: 80, branch: 55
end

0 comments on commit 11e5cbe

Please sign in to comment.