diff options
author | Anatoli Babenia <anatoli@rainforce.org> | 2022-10-14 10:01:29 +0300 |
---|---|---|
committer | Evan Read <eread@gitlab.com> | 2022-10-14 10:01:29 +0300 |
commit | 25ab77e7a8d1bdf91eeccb8a69f85ba38b6b489d (patch) | |
tree | 0a635aa97eba8800732eac0fdd834ce10306b924 | |
parent | c41d28d9e1dd028faec867479fd1194e46cebfc8 (diff) |
Add SimpleCov for code coverage
-rw-r--r-- | .eslintignore | 1 | ||||
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | .gitlab/ci/test.gitlab-ci.yml | 6 | ||||
-rw-r--r-- | .prettierignore | 1 | ||||
-rw-r--r-- | Gemfile | 2 | ||||
-rw-r--r-- | Gemfile.lock | 12 | ||||
-rw-r--r-- | spec/spec_helper.rb | 7 |
7 files changed, 30 insertions, 0 deletions
diff --git a/.eslintignore b/.eslintignore index 31662bc17..157478c6e 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,4 @@ +/coverage/ /node_modules/ /public/ /vendor/ diff --git a/.gitignore b/.gitignore index f2ea83de7..df16e7c96 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ tmp/ .yarn-cache/ vendor/ node_modules/ +coverage/ diff --git a/.gitlab/ci/test.gitlab-ci.yml b/.gitlab/ci/test.gitlab-ci.yml index b1c30972e..1289131af 100644 --- a/.gitlab/ci/test.gitlab-ci.yml +++ b/.gitlab/ci/test.gitlab-ci.yml @@ -56,6 +56,12 @@ rspec: stage: test script: - make rspec-tests + coverage: '/\(\d+.\d+\%\) covered/' + artifacts: + reports: + coverage_report: + coverage_format: cobertura + path: coverage/coverage.xml # # Run JavaScript tests diff --git a/.prettierignore b/.prettierignore index c62e1388c..eccbb6b68 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,3 +1,4 @@ +/coverage/ /node_modules/ /public/ /vendor/ @@ -23,6 +23,8 @@ group :test, :development do gem 'highline', '~> 2.0.3' gem 'rspec', '~> 3.11.0' gem 'rspec-parameterized', '~> 0.5.2' + gem 'simplecov', '~> 0.21.2', require: false + gem 'simplecov-cobertura', '~> 2.1', require: false gem 'pry-byebug', '~> 3.10.1', require: false gem 'gitlab-styles', '~> 9.0.0', require: false end diff --git a/Gemfile.lock b/Gemfile.lock index ba0b7891a..3d32acd05 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -54,6 +54,7 @@ GEM ddmetrics (1.0.1) ddplugin (1.0.3) diff-lcs (1.5.0) + docile (1.4.0) em-websocket (0.5.3) eventmachine (>= 0.12.9) http_parser.rb (~> 0) @@ -267,6 +268,15 @@ GEM sawyer (0.9.2) addressable (>= 2.3.5) faraday (>= 0.17.3, < 3) + simplecov (0.21.2) + docile (~> 1.1) + simplecov-html (~> 0.11) + simplecov_json_formatter (~> 0.1) + simplecov-cobertura (2.1.0) + rexml + simplecov (~> 0.19) + simplecov-html (0.12.3) + simplecov_json_formatter (0.1.4) slow_enumerator_tools (1.1.0) stringio (3.0.2) terminal-table (3.0.2) @@ -301,6 +311,8 @@ DEPENDENCIES rspec-parameterized (~> 0.5.2) sass (= 3.7.4) sassc (~> 2.4.0) + simplecov (~> 0.21.2) + simplecov-cobertura (~> 2.1) BUNDLED WITH 2.3.22 diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 762c465b5..29762f59d 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,12 @@ # frozen_string_literal: true +require 'simplecov' +require 'simplecov-cobertura' + +unless ENV['SIMPLECOV'] == '0' + SimpleCov.start + SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter +end $LOAD_PATH << 'lib/' require 'rspec-parameterized' |