1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-19 13:19:39 +02:00

Add simplecov (#760)

This commit is contained in:
Zach Gollwitzer 2024-05-17 18:12:31 -04:00 committed by GitHub
parent ac46c0c5a9
commit 22e6919eb5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 29 additions and 0 deletions

2
.gitignore vendored
View file

@ -53,3 +53,5 @@ compose-dev.yaml
# Ignore GCP keyfile # Ignore GCP keyfile
gcp-storage-keyfile.json gcp-storage-keyfile.json
coverage

View file

@ -71,4 +71,5 @@ group :test do
gem "vcr" gem "vcr"
gem "webmock" gem "webmock"
gem "climate_control" gem "climate_control"
gem "simplecov", require: false
end end

View file

@ -171,6 +171,7 @@ GEM
debug (1.9.2) debug (1.9.2)
irb (~> 1.10) irb (~> 1.10)
reline (>= 0.3.8) reline (>= 0.3.8)
docile (1.4.0)
dotenv (3.1.2) dotenv (3.1.2)
dotenv-rails (3.1.2) dotenv-rails (3.1.2)
dotenv (= 3.1.2) dotenv (= 3.1.2)
@ -399,6 +400,12 @@ GEM
sentry-ruby (5.17.3) sentry-ruby (5.17.3)
bigdecimal bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2) concurrent-ruby (~> 1.0, >= 1.0.2)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
smart_properties (1.17.0) smart_properties (1.17.0)
sorbet-runtime (0.5.11383) sorbet-runtime (0.5.11383)
stackprof (0.2.26) stackprof (0.2.26)
@ -493,6 +500,7 @@ DEPENDENCIES
selenium-webdriver selenium-webdriver
sentry-rails sentry-rails
sentry-ruby sentry-ruby
simplecov
stackprof stackprof
stimulus-rails stimulus-rails
tailwindcss-rails tailwindcss-rails

View file

@ -1,3 +1,10 @@
if ENV["COVERAGE"]
require "simplecov"
SimpleCov.start "rails" do
enable_coverage :branch
end
end
# Test ENV setup: # Test ENV setup:
# By default, all features should be disabled # By default, all features should be disabled
# Use the `with_env_overrides` helper to enable features for individual tests # Use the `with_env_overrides` helper to enable features for individual tests
@ -28,6 +35,17 @@ module ActiveSupport
# Run tests in parallel with specified workers # Run tests in parallel with specified workers
parallelize(workers: :number_of_processors) parallelize(workers: :number_of_processors)
# https://github.com/simplecov-ruby/simplecov/issues/718#issuecomment-538201587
if ENV["COVERAGE"]
parallelize_setup do |worker|
SimpleCov.command_name "#{SimpleCov.command_name}-#{worker}"
end
parallelize_teardown do |worker|
SimpleCov.result
end
end
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
fixtures :all fixtures :all