From 955c934ca54e6a3738e9908c15c71f38f12cfcda Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Mon, 15 Jun 2026 20:05:42 +1200 Subject: [PATCH] Make coverage dependency optional for tests The default Test workflow does not produce coverage artifacts, but its bundle still installed covered and ruby-coverage. The latest ruby-coverage currently fails during installation on JRuby and Windows before io-event tests can run. Move covered into an optional coverage bundle group and only load covered/sus when COVERAGE is configured. The coverage workflow opts into that group with BUNDLE_WITH=coverage, preserving coverage reporting while keeping the plain test matrix focused on io-event. --- .github/workflows/test-coverage.yaml | 1 + config/sus.rb | 6 ++++-- gems.rb | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index cab28db5..7ac30dcb 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -7,6 +7,7 @@ permissions: env: COVERAGE: PartialSummary + BUNDLE_WITH: coverage jobs: test: diff --git a/config/sus.rb b/config/sus.rb index 7a44c99a..47692930 100644 --- a/config/sus.rb +++ b/config/sus.rb @@ -7,8 +7,10 @@ Warning[:experimental] = false -require "covered/sus" -include Covered::Sus +if ENV.key?("COVERAGE") + require "covered/sus" + include Covered::Sus +end # Intensive GC checking: # diff --git a/gems.rb b/gems.rb index efd90062..babeb5a9 100644 --- a/gems.rb +++ b/gems.rb @@ -20,7 +20,6 @@ group :test do gem "sus" gem "sus-fixtures-benchmark" - gem "covered" gem "decode" gem "rubocop" @@ -31,3 +30,7 @@ gem "bake-test-external" gem "async" end + +group :coverage, optional: true do + gem "covered" +end