From 5b73c915956d52c0722f827736f85560ad3629fd Mon Sep 17 00:00:00 2001 From: exoego Date: Thu, 29 Jun 2023 10:39:56 +0900 Subject: [PATCH] Enable branch-coverage --- .github/workflows/test.yml | 5 +++++ .simplecov_spawn.rb | 1 + Gemfile | 2 +- scripts/rspec_with_simplecov | 3 +-- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a89032c4..622ac97b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,6 +34,11 @@ jobs: - uses: actions/checkout@v2 - name: bundle install run: bundle install -j$(nproc) --retry 3 + - name: install simplecov-fork only for minitest with coverage + run: | + gem install specific_install + gem specific_install https://github.com/exoego/simplecov.git branch-fix + if: matrix.coverage == 'coverage' - run: bundle exec rspec timeout-minutes: 1 - name: Upload coverage reports diff --git a/.simplecov_spawn.rb b/.simplecov_spawn.rb index 040e7669..0b5cd0c2 100644 --- a/.simplecov_spawn.rb +++ b/.simplecov_spawn.rb @@ -9,6 +9,7 @@ SimpleCov::Formatter::CoberturaFormatter, ]) SimpleCov.start do + enable_coverage :branch add_filter '/spec/' add_filter '/scripts/' end diff --git a/Gemfile b/Gemfile index 897b4735..edcdb401 100644 --- a/Gemfile +++ b/Gemfile @@ -10,7 +10,7 @@ gem 'roda' gem 'rspec-rails' group :test do - gem 'simplecov' + gem 'simplecov', git: 'https://github.com/exoego/simplecov.git', branch: 'branch-fix' gem 'simplecov-cobertura' gem 'super_diff' end diff --git a/scripts/rspec_with_simplecov b/scripts/rspec_with_simplecov index b6fa6544..3ced42e9 100755 --- a/scripts/rspec_with_simplecov +++ b/scripts/rspec_with_simplecov @@ -36,8 +36,7 @@ begin require 'simplecov' SimpleCov.start do - # Flaky :( - # enable_coverage :branch + enable_coverage :branch end end rescue LoadError