mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-18 04:39:14 +00:00
Configure SimpleCov as recommended by author
The configuration can go into the central .simplecov file and then we just need to `require` simplecov to start the coverage process. This also avoids duplicating the config if we want to start simplecov from the rails server to cover the lines used in by the server in feature specs. https://github.com/simplecov-ruby/simplecov#using-simplecov-for-centralized-config
This commit is contained in:
18
.simplecov
Normal file
18
.simplecov
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/env ruby
|
||||
|
||||
SimpleCov.start 'rails' do
|
||||
minimum_coverage 54
|
||||
|
||||
add_filter '/bin/'
|
||||
add_filter '/config/'
|
||||
add_filter '/jobs/application_job.rb'
|
||||
add_filter '/schemas/'
|
||||
add_filter '/lib/generators'
|
||||
add_filter '/spec/'
|
||||
add_filter '/vendor/'
|
||||
add_filter '/public'
|
||||
add_filter '/swagger'
|
||||
add_filter '/script'
|
||||
add_filter '/log'
|
||||
add_filter '/db'
|
||||
end
|
||||
@@ -1,21 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
if ENV["COVERAGE"]
|
||||
require 'simplecov'
|
||||
|
||||
SimpleCov.minimum_coverage 54
|
||||
SimpleCov.start 'rails' do
|
||||
add_filter '/bin/'
|
||||
add_filter '/config/'
|
||||
add_filter '/jobs/application_job.rb'
|
||||
add_filter '/schemas/'
|
||||
add_filter '/lib/generators'
|
||||
add_filter '/spec/'
|
||||
add_filter '/vendor/'
|
||||
add_filter '/public'
|
||||
add_filter '/swagger'
|
||||
add_filter '/script'
|
||||
add_filter '/log'
|
||||
add_filter '/db'
|
||||
end
|
||||
end
|
||||
@@ -1,9 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
if ENV["COVERAGE"]
|
||||
require 'simplecov'
|
||||
SimpleCov.start 'rails'
|
||||
end
|
||||
require 'simplecov' if ENV["COVERAGE"]
|
||||
|
||||
require 'rubygems'
|
||||
|
||||
@@ -24,7 +21,6 @@ require 'rspec/rails'
|
||||
require 'capybara'
|
||||
require 'database_cleaner'
|
||||
require 'rspec/retry'
|
||||
require 'coverage_helper'
|
||||
require 'paper_trail/frameworks/rspec'
|
||||
|
||||
require 'webdrivers'
|
||||
|
||||
Reference in New Issue
Block a user