From a0d8dce7eb592e5bb9842fa035e3c73f3f39fd08 Mon Sep 17 00:00:00 2001 From: Adam Ploshay Date: Thu, 13 Feb 2025 18:58:56 -0500 Subject: [PATCH 1/4] add simplecov --- .gitignore | 1 + Gemfile | 1 + Gemfile.lock | 8 ++++++++ spec/spec_helper.rb | 10 ++++++++++ 4 files changed, 20 insertions(+) diff --git a/.gitignore b/.gitignore index 88c098d0..21663fd7 100644 --- a/.gitignore +++ b/.gitignore @@ -77,3 +77,4 @@ config/settings/*.local.yml vendor/* import/* *.swp +coverage/ diff --git a/Gemfile b/Gemfile index ab3bdc43..448b5f33 100644 --- a/Gemfile +++ b/Gemfile @@ -135,6 +135,7 @@ group :development, :test do gem 'rspec_junit_formatter' gem 'selenium-webdriver', '~> 4.2.0' gem 'shoulda-matchers', '~> 3.1' + gem 'simplecov' gem 'solr_wrapper', '~> 2.1.0' end diff --git a/Gemfile.lock b/Gemfile.lock index 20999390..79bf49cd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -249,6 +249,7 @@ GEM devise-guests (0.8.3) devise diff-lcs (1.5.1) + docile (1.4.1) docopt (0.5.0) dotenv (2.8.1) dotenv-rails (2.8.1) @@ -961,6 +962,12 @@ GEM simple_form (5.0.3) actionpack (>= 5.0) activemodel (>= 5.0) + simplecov (0.22.0) + docile (~> 1.1) + simplecov-html (~> 0.11) + simplecov_json_formatter (~> 0.1) + simplecov-html (0.13.1) + simplecov_json_formatter (0.1.4) sinatra (3.0.6) mustermann (~> 3.0) rack (~> 2.2, >= 2.2.4) @@ -1130,6 +1137,7 @@ DEPENDENCIES sassc (>= 2.0.0) selenium-webdriver (~> 4.2.0) shoulda-matchers (~> 3.1) + simplecov sinatra (~> 3.0.6) solr_wrapper (~> 2.1.0) spring diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 0790d672..c977edd6 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,15 @@ +require 'simplecov' +SimpleCov.start 'rails' do + add_group('Actors', 'app/actors') + add_group('Forms', 'app/forms') + add_group('Indexers', 'app/indexers') + add_group('Presenters', 'app/presenters') + add_group('Services', 'app/services') +end + ENV["RAILS_ENV"] ||= 'test' require File.expand_path("../../config/environment", __FILE__) + require 'rspec/rails' require 'factory_bot' require 'rspec/its' From f1e6fbada1dd787565ac241a00322c146281bd6c Mon Sep 17 00:00:00 2001 From: Adam Ploshay Date: Wed, 25 Jun 2025 10:27:53 -0400 Subject: [PATCH 2/4] add simplecov coverage to circleci artifacts --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index c3eb8f85..cf1bfd1a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -126,3 +126,5 @@ jobs: - store_artifacts: path: /tmp/test-results destination: test-results + - store_artifacts: + path: coverage From ceb79778f031bc7e75488903ce957fc5a284df1d Mon Sep 17 00:00:00 2001 From: Adam Ploshay Date: Wed, 25 Jun 2025 11:04:40 -0400 Subject: [PATCH 3/4] add coveralls_reborn gem --- Gemfile | 1 + Gemfile.lock | 12 ++++++++++++ spec/spec_helper.rb | 5 +++++ 3 files changed, 18 insertions(+) diff --git a/Gemfile b/Gemfile index 448b5f33..dbe12da9 100644 --- a/Gemfile +++ b/Gemfile @@ -136,6 +136,7 @@ group :development, :test do gem 'selenium-webdriver', '~> 4.2.0' gem 'shoulda-matchers', '~> 3.1' gem 'simplecov' + gem 'coveralls_reborn' gem 'solr_wrapper', '~> 2.1.0' end diff --git a/Gemfile.lock b/Gemfile.lock index 79bf49cd..d43540d1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -227,6 +227,11 @@ GEM deep_merge (~> 1.2, >= 1.2.1) ostruct connection_pool (2.4.1) + coveralls_reborn (0.29.0) + simplecov (~> 0.22.0) + term-ansicolor (~> 1.7) + thor (~> 1.2) + tins (~> 1.32) crass (1.0.6) csv (3.3.0) database_cleaner (2.1.0) @@ -1018,11 +1023,17 @@ GEM sxp (1.2.4) matrix (~> 0.4) rdf (~> 3.2) + sync (0.5.0) temple (0.10.3) + term-ansicolor (1.11.2) + tins (~> 1.0) thor (1.3.2) thread_safe (0.3.6) tilt (2.4.0) timeout (0.4.3) + tins (1.38.0) + bigdecimal + sync tinymce-rails (4.9.11.1) railties (>= 3.1.1) trailblazer-option (0.1.2) @@ -1081,6 +1092,7 @@ DEPENDENCIES clamav-client coffee-rails (~> 4.2) config + coveralls_reborn database_cleaner devise devise-guests (~> 0.6) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c977edd6..a7916f5b 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,4 +1,9 @@ require 'simplecov' +require 'coveralls' +SimpleCov.formatters = [ + SimpleCov::Formatter::HTMLFormatter, + Coveralls::SimpleCov::Formatter +] SimpleCov.start 'rails' do add_group('Actors', 'app/actors') add_group('Forms', 'app/forms') From 9dd43a9efe8d00d16b7a69420094e0df4268bf94 Mon Sep 17 00:00:00 2001 From: Adam Ploshay Date: Wed, 25 Jun 2025 10:57:51 -0400 Subject: [PATCH 4/4] add coveralls to CircleCI --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index cf1bfd1a..7b5abd10 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,6 +7,7 @@ version: 2.1 orbs: browser-tools: circleci/browser-tools@1.4.1 ruby: circleci/ruby@1.8.0 + coveralls: coveralls/coveralls@2.2.5 default_environment: &default_environment RAILS_ENV: test @@ -119,6 +120,8 @@ jobs: command: | mkdir /tmp/test-results bundle exec rspec + - coveralls/upload: + coverage_format: simplecov # collect reports - store_test_results: