A RSpec plugin that generates coverage data for CircleCI's Smarter Testing.
Add the plugin to the Gemfile:
gem 'rspec-circleci-coverage', :github => 'circleci/rspec-circleci-coverage'Install the plugin:
bundle installAdd the plugin to your spec_helper.rb
require "rspec-circleci-coverage"To generate coverage, set the CIRCLECI_COVERAGE environment variable:
CIRCLECI_COVERAGE=coverage.json bundle exec rspecRun the integration tests:
bundle install
bundle exec rspecGenerate the testsuite integration test:
circleci run testsuite 'integration test' --local --test-analysis=all && cat coverage.json | jq --sort-keys > coveragetmp.json && mv coveragetmp.json coverage.json