FAQ / knapsack_pro / General questions for knapsack_pro gem

How to use simplecov in Queue Mode?

If you would like to make simplecov gem work with knapsack_pro Queue Mode to correctly track code coverage for parallel CI nodes please do:


# spec_helper.rb or rails_helper.rb
require 'knapsack_pro'

require 'simplecov'
SimpleCov.start

KnapsackPro::Hooks::Queue.before_queue do |queue_id|
  SimpleCov.command_name("rspec_ci_node_#{KnapsackPro::Config::Env.ci_node_index}")
end

This way there should be no conflict between code coverage reports generated per CI node index even when you use the same local drive (for instance you use Jenkins as your CI provider). The simplecov will generate single report at coverage/index.html with merged data from parallel CI nodes if the local drive is common between parallel CI nodes.

If your parallel CI nodes are isolated containers you would like to merge simplecov reports from parallel CI nodes into one report for instance with CodeClimate.

General questions for knapsack_pro gem
See questions outside of this category

Start using Knapsack Pro

Sign up and speed up your tests.