Skip to content

Commit

Permalink
Applies code to avoid conflicts between code coverage reports
Browse files Browse the repository at this point in the history
...generated by parallel CI nodes, according to documentation here: https://docs.knapsackpro.com/ruby/simplecov/
  • Loading branch information
filipefurtad0 committed Jul 18, 2024
1 parent de20dd9 commit 744204b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion spec/base_spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

ENV["RAILS_ENV"] ||= 'test'

require 'simplecov' if ENV["COVERAGE"]
require 'rubygems'
require 'pry' unless ENV['CI']
require 'view_component/test_helpers'
Expand All @@ -27,6 +26,14 @@
require 'knapsack_pro'
KnapsackPro::Adapters::RSpecAdapter.bind

require 'simplecov' if ENV["COVERAGE"]

SimpleCov.start

KnapsackPro::Hooks::Queue.before_queue do |queue_id|

Check warning on line 33 in spec/base_spec_helper.rb

View workflow job for this annotation

GitHub Actions / runner / rubocop

[rubocop] reported by reviewdog 🐶 Unused block argument - `queue_id`. You can omit the argument if you don't care about it. Raw Output: spec/base_spec_helper.rb:33:44: W: Lint/UnusedBlockArgument: Unused block argument - `queue_id`. You can omit the argument if you don't care about it.
SimpleCov.command_name("rspec_ci_node_#{KnapsackPro::Config::Env.ci_node_index}")
end

# Allow connections to selenium whilst raising errors when connecting to external sites
require 'webmock/rspec'
WebMock.enable!
Expand Down

0 comments on commit 744204b

Please sign in to comment.