Skip to content

Commit

Permalink
Merge pull request #64 from KnapsackPro/simplecov
Browse files Browse the repository at this point in the history
Update simplecov from 0.17.1 to 0.22.0 and update config for Minitest + Queue Mode + simplecov
  • Loading branch information
ArturT authored Jun 5, 2024
2 parents 9734e9b + 1552e7f commit 6d3a782
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ jobs:
- run:
name: Code Climate Test Coverage
command: |
./cc-test-reporter format-coverage -t simplecov -o "coverage/codeclimate.$CIRCLE_NODE_INDEX.json"
./cc-test-reporter format-coverage -t simplecov -o "coverage/codeclimate.$CIRCLE_NODE_INDEX.json" --debug
- persist_to_workspace:
root: coverage
paths:
Expand Down
4 changes: 1 addition & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,7 @@ group :test do
#gem 'capybara-screenshot', github: 'ArturT/capybara-screenshot', branch: 'fix-reporter_module-loaded-twice'

gem 'shared_should', require: false
# use older simplecov to fix an issue with CodeClimate
# https://github.com/codeclimate/test-reporter/issues/418
gem 'simplecov', '0.17.1', require: false
gem 'simplecov', require: false
end

gem "turnip", "~> 4.4"
Expand Down
11 changes: 6 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -316,11 +316,12 @@ GEM
shoulda-context (2.0.0)
shoulda-matchers (4.5.1)
activesupport (>= 4.2.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.12.3)
simplecov_json_formatter (0.1.4)
spinach (0.12.0)
colorize
gherkin-ruby (>= 0.3.2)
Expand Down Expand Up @@ -422,7 +423,7 @@ DEPENDENCIES
rspec_junit_formatter
sass-rails (~> 5.0)
shared_should
simplecov (= 0.17.1)
simplecov
spinach
spring
spring-commands-cucumber
Expand Down
6 changes: 6 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
#KnapsackPro.logger.level = Logger::INFO

require 'simplecov'

if ENV['CI']
require 'simplecov_json_formatter'
SimpleCov.formatter = SimpleCov::Formatter::JSONFormatter
end

SimpleCov.start


Expand Down
10 changes: 10 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,22 @@
knapsack_pro_adapter.set_test_helper_path(__FILE__)

require 'simplecov'

if ENV['CI']
require 'simplecov_json_formatter'
SimpleCov.formatter = SimpleCov::Formatter::JSONFormatter
end

SimpleCov.start

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

KnapsackPro::Hooks::Queue.after_queue do
SimpleCov.result.format!
end

class ActiveSupport::TestCase
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
fixtures :all
Expand Down

0 comments on commit 6d3a782

Please sign in to comment.