diff --git a/.circleci/config.yml b/.circleci/config.yml index c3eb8f85..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: @@ -126,3 +129,5 @@ jobs: - store_artifacts: path: /tmp/test-results destination: test-results + - store_artifacts: + path: coverage 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..dbe12da9 100644 --- a/Gemfile +++ b/Gemfile @@ -135,6 +135,8 @@ group :development, :test do gem 'rspec_junit_formatter' 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 20999390..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) @@ -249,6 +254,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 +967,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) @@ -1011,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) @@ -1074,6 +1092,7 @@ DEPENDENCIES clamav-client coffee-rails (~> 4.2) config + coveralls_reborn database_cleaner devise devise-guests (~> 0.6) @@ -1130,6 +1149,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..a7916f5b 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,20 @@ +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') + 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'