diff --git a/.circleci/config.yml b/.circleci/config.yml index 5928b3d5..b1b15f52 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -74,7 +74,9 @@ jobs: name: test_executor environment: - PHOENIX_URI: http://localhost:4000 + - PHOENIX_URI: http://localhost:4000 + - CC_TEST_REPORTER_ID: a561562e78b6f0b3e346d4811eef2b020f977cd089bf459f102f6229dd100703 + parallelism: 1 @@ -104,7 +106,8 @@ jobs: --format progress \ $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings) - ./cc-test-reporter format-coverage \ + ./cc-test-reporter format-coverage coverage/coverage.json \ + --input-type simplecov \ --output coverage/codeclimate.rspec.$CIRCLE_NODE_INDEX.3.2.4.json - persist_to_workspace: @@ -125,7 +128,7 @@ jobs: name: test_executor environment: - - CC_TEST_REPORTER_ID: "a561562e78b6f0b3e346d4811eef2b020f977cd089bf459f102f6229dd100703" + - CC_TEST_REPORTER_ID: a561562e78b6f0b3e346d4811eef2b020f977cd089bf459f102f6229dd100703 steps: - restore_cache: diff --git a/.simplecov b/.simplecov index 1d3e67c4..03808bb1 100644 --- a/.simplecov +++ b/.simplecov @@ -1,19 +1,8 @@ -if ENV['CIRCLECI'] - SimpleCov.at_exit do - result_hash = SimpleCov.result.to_hash +SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new( + [SimpleCov::Formatter::HTMLFormatter, SimpleCov::Formatter::JSONFormatter] +) - if result_hash.keys == ['Cucumber, RSpec'] - if SimpleCov.result.covered_percent < 100 - puts "=========== Lines missing coverage: ===========" - result_hash['Cucumber, RSpec']['coverage'].each do |file_name, file_lines| - file_lines.each_with_index { |val, index| puts "#{file_name}, #{index + 1}" if val == 0 } - end - end - end - end -end - -SimpleCov.start 'rails' do +SimpleCov.start :rails do add_filter '/vendor/' add_filter '/.bundler/' add_filter '/.nix-bundler/' diff --git a/Gemfile b/Gemfile index 40da774e..2ef7f47d 100644 --- a/Gemfile +++ b/Gemfile @@ -88,7 +88,7 @@ end group :test do gem "webmock" gem "rspec_junit_formatter" - gem 'simplecov', '~> 0.17.0', require: false + gem 'simplecov', '~> 0.22.0', require: false gem "rails-controller-testing" end diff --git a/Gemfile.lock b/Gemfile.lock index 5a39e28e..36bd1ae1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -328,11 +328,12 @@ GEM rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) - simplecov (0.17.1) + simplecov (0.22.0) docile (~> 1.1) - json (>= 1.8, < 3) - simplecov-html (~> 0.10.0) - simplecov-html (0.10.2) + simplecov-html (~> 0.11) + simplecov_json_formatter (~> 0.1) + simplecov-html (0.13.1) + simplecov_json_formatter (0.1.4) stimulus-rails (1.3.4) railties (>= 6.0.0) stringio (3.1.2) @@ -411,7 +412,7 @@ DEPENDENCIES rubocop-rake rubocop-rspec selenium-webdriver (>= 4.24.0) - simplecov (~> 0.17.0) + simplecov (~> 0.22.0) stimulus-rails turbo-rails tzinfo-data diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index d771071f..661a8c8c 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,8 +2,6 @@ require 'webmock/rspec' require 'securerandom' -SimpleCov.command_name 'RSpec' - # See https://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration RSpec.configure do |config| config.expect_with :rspec do |expectations|