mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-01 02:03:22 +00:00
Use new Undercover formatter for :nocov: support
This commit is contained in:
@@ -16,6 +16,7 @@ AllCops:
|
||||
- node_modules/**/*
|
||||
# Excluding: inadequate Naming/FileName rule rejects GemFile name with camelcase
|
||||
- engines/web/Gemfile
|
||||
- .undercover
|
||||
|
||||
Bundler/DuplicatedGem:
|
||||
Enabled: false
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#!/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
-l coverage/lcov/openfoodnetwork.lcov
|
||||
-c master
|
||||
-c master
|
||||
|
||||
2
Gemfile
2
Gemfile
@@ -172,8 +172,6 @@ end
|
||||
group :test do
|
||||
gem 'pdf-reader'
|
||||
gem 'rails-controller-testing'
|
||||
gem 'simplecov', require: false
|
||||
gem 'simplecov-lcov', require: false
|
||||
gem 'undercover', require: false
|
||||
gem 'vcr', require: false
|
||||
gem 'webmock', require: false
|
||||
|
||||
@@ -746,7 +746,6 @@ GEM
|
||||
simplecov-html (~> 0.11)
|
||||
simplecov_json_formatter (~> 0.1)
|
||||
simplecov-html (0.12.3)
|
||||
simplecov-lcov (0.8.0)
|
||||
simplecov_json_formatter (0.1.4)
|
||||
spreadsheet_architect (5.0.0)
|
||||
caxlsx (>= 3.3.0, < 4)
|
||||
@@ -991,8 +990,6 @@ DEPENDENCIES
|
||||
shoulda-matchers
|
||||
sidekiq
|
||||
sidekiq-scheduler
|
||||
simplecov
|
||||
simplecov-lcov
|
||||
spreadsheet_architect
|
||||
spring
|
||||
spring-commands-rspec
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace :simplecov do
|
||||
task :collate_results, # rubocop:disable Rails/RakeEnvironment doesn't need the full env
|
||||
[:path_to_results, :coverage_dir] do |_t, args|
|
||||
require "simplecov"
|
||||
require "simplecov-lcov"
|
||||
require "undercover/simplecov_formatter"
|
||||
|
||||
path_to_results = args[:path_to_results].presence || "tmp/simplecov"
|
||||
output_path = args[:coverage_dir].presence || "coverage"
|
||||
@@ -15,9 +15,8 @@ namespace :simplecov do
|
||||
coverage_dir(output_path)
|
||||
end
|
||||
|
||||
SimpleCov::Formatter::LcovFormatter.config.report_with_single_file = true
|
||||
SimpleCov.collate Dir[File.join(path_to_results, "**", ".resultset.json")], "rails" do
|
||||
formatter(SimpleCov::Formatter::LcovFormatter)
|
||||
formatter(SimpleCov::Formatter::Undercover)
|
||||
coverage_dir(output_path)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -26,6 +26,10 @@ RSpec.describe "simplecov.rake" do
|
||||
|
||||
and change { File.exist?(File.join(output_dir, "index.html")) }.
|
||||
from(false).
|
||||
to(true).
|
||||
|
||||
and change { File.exist?(File.join(output_dir, "coverage.json")) }.
|
||||
from(false).
|
||||
to(true)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user