diff --git a/.simplecov b/.simplecov index 1f84c715475..442f5abda43 100644 --- a/.simplecov +++ b/.simplecov @@ -12,15 +12,16 @@ SimpleCov.configure do formatter SimpleCov::Formatter::HTMLFormatter end - enable_coverage :branch + enable_coverage :branch, :eval - add_filter 'lib/linter' + skip 'lib/linter' - add_group 'Libraries', 'lib' - add_group 'Policies', 'app/policies' - add_group 'Presenters', 'app/presenters' - add_group 'Search', 'app/chewy' - add_group 'Serializers', 'app/serializers' - add_group 'Services', 'app/services' - add_group 'Validators', 'app/validators' + group 'Libraries', 'lib' + group 'Policies', 'app/policies' + group 'Presenters', 'app/presenters' + group 'Search', 'app/chewy' + group 'Serializers', 'app/serializers' + group 'Services', 'app/services' + group 'Validators', 'app/validators' + group 'Views', 'app/views' end diff --git a/Gemfile b/Gemfile index 1d00a60e7e5..0945fef4ce8 100644 --- a/Gemfile +++ b/Gemfile @@ -153,7 +153,7 @@ group :test do gem 'shoulda-matchers' # Coverage formatter for RSpec - gem 'simplecov', '~> 0.22', require: false + gem 'simplecov', require: false gem 'simplecov-lcov', '~> 0.8', require: false # Stub web requests for specs diff --git a/Gemfile.lock b/Gemfile.lock index 67e66054367..daeb1d36df1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -209,7 +209,6 @@ GEM diff-lcs (1.6.2) discard (2.0.0) activerecord (>= 7.0, < 9.0) - docile (1.4.1) domain_name (0.6.20240107) doorkeeper (5.9.3) railties (>= 5) @@ -839,13 +838,8 @@ GEM simple_form (5.4.1) actionpack (>= 7.0) activemodel (>= 7.0) - simplecov (0.22.0) - docile (~> 1.1) - simplecov-html (~> 0.11) - simplecov_json_formatter (~> 0.1) - simplecov-html (0.13.2) + simplecov (1.0.0) simplecov-lcov (0.9.0) - simplecov_json_formatter (0.1.4) ssrf_filter (1.5.0) stackprof (0.2.28) starry (0.2.0) @@ -1085,7 +1079,7 @@ DEPENDENCIES sidekiq-unique-jobs (> 8) simple-navigation (~> 4.4) simple_form (~> 5.2) - simplecov (~> 0.22) + simplecov simplecov-lcov (~> 0.8) stackprof stoplight diff --git a/config/initializers/simple_cov_source_file.rb b/config/initializers/simple_cov_source_file.rb deleted file mode 100644 index c6b3586c825..00000000000 --- a/config/initializers/simple_cov_source_file.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -# TODO: https://github.com/simplecov-ruby/simplecov/pull/1084 -# Patches this missing condition, monitor for upstream fix - -module SimpleCov - module SourceFileExtensions - def build_branches - coverage_branch_data = coverage_data.fetch('branches', {}) || {} # Add the final empty hash in case where 'branches' is present, but returns nil - branches = coverage_branch_data.flat_map do |condition, coverage_branches| - build_branches_from(condition, coverage_branches) - end - - process_skipped_branches(branches) - end - end -end - -SimpleCov::SourceFile.prepend(SimpleCov::SourceFileExtensions) if defined?(SimpleCov::SourceFile)