mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-26 01:33:22 +00:00
Changes rake task to include merging of the lcov result files
This commit is contained in:
@@ -5,6 +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"
|
||||
|
||||
path_to_results = args[:path_to_results].presence || "tmp/simplecov"
|
||||
output_path = args[:coverage_dir].presence || "coverage"
|
||||
@@ -13,5 +14,11 @@ namespace :simplecov do
|
||||
formatter(SimpleCov::Formatter::HTMLFormatter)
|
||||
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)
|
||||
coverage_dir(output_path)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user