From c7a6b43c72ceebe59cd1fd1a6f78702ff12ef22e Mon Sep 17 00:00:00 2001 From: nick evans Date: Mon, 28 Apr 2025 11:27:40 -0400 Subject: [PATCH 1/5] =?UTF-8?q?=E2=9C=85=20Skip=20simplecov=20for=20non-CR?= =?UTF-8?q?uby=20engines?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/test.yml | 3 ++- Gemfile | 6 +++--- test/lib/helper.rb | 4 +++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 726ee0c1e..fcaa290c8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,7 +36,8 @@ jobs: timeout-minutes: 5 # _should_ finish in under a minute - uses: joshmfrankel/simplecov-check-action@main - if: matrix.os == 'ubuntu-latest' && github.event_name != 'pull_request' + if: ${{ matrix.os == 'ubuntu-latest' && github.event_name != 'pull_request' && + !startsWith(matrix.ruby, 'truffleruby') && !startsWith(matrix.ruby, 'jruby') }} with: check_job_name: "SimpleCov - ${{ matrix.ruby }}" minimum_suite_coverage: 90 diff --git a/Gemfile b/Gemfile index 0b764c98e..43d65e469 100644 --- a/Gemfile +++ b/Gemfile @@ -19,7 +19,7 @@ gem "benchmark-driver", require: false gem "vernier", require: false, platform: :mri group :test do - gem "simplecov", require: false - gem "simplecov-html", require: false - gem "simplecov-json", require: false + gem "simplecov", require: false, platforms: %i[mri windows] + gem "simplecov-html", require: false, platforms: %i[mri windows] + gem "simplecov-json", require: false, platforms: %i[mri windows] end diff --git a/test/lib/helper.rb b/test/lib/helper.rb index 6a01a53e8..61fbb1231 100644 --- a/test/lib/helper.rb +++ b/test/lib/helper.rb @@ -1,4 +1,6 @@ -unless ENV["SIMPLECOV_DISABLE"] in /\A(1|y(es)?|t(rue)?)\z/i +if !(ENV["SIMPLECOV_DISABLE"] in /\A(1|y(es)?|t(rue)?)\z/i) && + RUBY_ENGINE == "ruby" # C Ruby only + require "simplecov" # Cannot use ".simplecov" file: simplecov-json triggers a circular require. From 9b9a89c9e3c8c09b072955c40881e1cfa1eb8d90 Mon Sep 17 00:00:00 2001 From: nick evans Date: Mon, 5 May 2025 14:05:22 -0400 Subject: [PATCH 2/5] =?UTF-8?q?=E2=9C=85=20Add=20TruffleRuby/JRuby=20pend/?= =?UTF-8?q?omit=20test=20helpers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/lib/helper.rb | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/test/lib/helper.rb b/test/lib/helper.rb index 61fbb1231..917e604a1 100644 --- a/test/lib/helper.rb +++ b/test/lib/helper.rb @@ -73,6 +73,46 @@ def assert_pattern end end + def pend_if(condition, *args, &block) + if condition + pend(*args, &block) + else + block.call if block + end + end + + def pend_unless(condition, *args, &block) + if condition + block.call if block + else + pend(*args, &block) + end + end + + def omit_unless_cruby(msg = "test omitted for non-CRuby", &block) + omit_unless(RUBY_ENGINE == "ruby", msg, &block) + end + + def omit_if_truffleruby(msg = "test omitted on TruffleRuby", &block) + omit_if(RUBY_ENGINE == "truffleruby", msg, &block) + end + + def omit_if_jruby(msg = "test omitted on JRuby", &block) + omit_if(RUBY_ENGINE == "jruby", msg, &block) + end + + def pend_unless_cruby(msg = "test is pending for non-CRuby", &block) + pend_unless(RUBY_ENGINE == "ruby", msg, &block) + end + + def pend_if_truffleruby(msg = "test is pending on TruffleRuby", &block) + pend_if(RUBY_ENGINE == "truffleruby", msg, &block) + end + + def pend_if_jruby(msg = "test is pending on JRuby", &block) + pend_if(RUBY_ENGINE == "jruby", msg, &block) + end + end require_relative "profiling_helper" From 6d42c16a406a107e4e6b0be3f352314944d06cea Mon Sep 17 00:00:00 2001 From: nick evans Date: Fri, 3 Oct 2025 18:34:27 -0400 Subject: [PATCH 3/5] =?UTF-8?q?=E2=9C=85=F0=9F=9A=A7=20Mark=201=20::Data?= =?UTF-8?q?=20test=20as=20pending=20for=20TruffleRuby?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/net/imap/test_data_lite.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/net/imap/test_data_lite.rb b/test/net/imap/test_data_lite.rb index 3d71a4bbb..42681a0e1 100644 --- a/test/net/imap/test_data_lite.rb +++ b/test/net/imap/test_data_lite.rb @@ -374,7 +374,9 @@ class InheritsOverride < AbstractWithOverride.define(:foo) def test_subclass_override_deconstruct data = InheritsOverride[:foo] - assert_equal %i[ok foo], data.deconstruct + pend_if_truffleruby do + assert_equal %i[ok foo], data.deconstruct + end end end From 50f83b810c092c7b680c00136b5bb1840bbc48ab Mon Sep 17 00:00:00 2001 From: nick evans Date: Mon, 9 Jun 2025 10:58:05 -0400 Subject: [PATCH 4/5] =?UTF-8?q?=E2=9C=85=F0=9F=9A=A7=20Mark=202=20Connecti?= =?UTF-8?q?onState=20tests=20as=20pending=20for=20TruffleRuby?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/net/imap/test_connection_state.rb | 28 +++++++++++++++----------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/test/net/imap/test_connection_state.rb b/test/net/imap/test_connection_state.rb index 8309de5d1..ec6b11ebd 100644 --- a/test/net/imap/test_connection_state.rb +++ b/test/net/imap/test_connection_state.rb @@ -25,21 +25,25 @@ class ConnectionStateTest < Net::IMAP::TestCase end test "#deconstruct" do - assert_equal [:not_authenticated], NotAuthenticated[].deconstruct - assert_equal [:authenticated], Authenticated[] .deconstruct - assert_equal [:selected], Selected[] .deconstruct - assert_equal [:logout], Logout[] .deconstruct + pend_if_truffleruby "TruffleRuby bug overriding ::Data methods" do + assert_equal [:not_authenticated], NotAuthenticated[].deconstruct + assert_equal [:authenticated], Authenticated[] .deconstruct + assert_equal [:selected], Selected[] .deconstruct + assert_equal [:logout], Logout[] .deconstruct + end end test "#deconstruct_keys" do - assert_equal({symbol: :not_authenticated}, NotAuthenticated[].deconstruct_keys([:symbol])) - assert_equal({symbol: :authenticated}, Authenticated[] .deconstruct_keys([:symbol])) - assert_equal({symbol: :selected}, Selected[] .deconstruct_keys([:symbol])) - assert_equal({symbol: :logout}, Logout[] .deconstruct_keys([:symbol])) - assert_equal({name: "not_authenticated"}, NotAuthenticated[].deconstruct_keys([:name])) - assert_equal({name: "authenticated"}, Authenticated[] .deconstruct_keys([:name])) - assert_equal({name: "selected"}, Selected[] .deconstruct_keys([:name])) - assert_equal({name: "logout"}, Logout[] .deconstruct_keys([:name])) + pend_if_truffleruby "TruffleRuby bug overriding ::Data methods" do + assert_equal({symbol: :not_authenticated}, NotAuthenticated[].deconstruct_keys([:symbol])) + assert_equal({symbol: :authenticated}, Authenticated[] .deconstruct_keys([:symbol])) + assert_equal({symbol: :selected}, Selected[] .deconstruct_keys([:symbol])) + assert_equal({symbol: :logout}, Logout[] .deconstruct_keys([:symbol])) + assert_equal({name: "not_authenticated"}, NotAuthenticated[].deconstruct_keys([:name])) + assert_equal({name: "authenticated"}, Authenticated[] .deconstruct_keys([:name])) + assert_equal({name: "selected"}, Selected[] .deconstruct_keys([:name])) + assert_equal({name: "logout"}, Logout[] .deconstruct_keys([:name])) + end end test "#not_authenticated?" do From ad5eb96cb191f38c50f4094bcb73d37ba524759c Mon Sep 17 00:00:00 2001 From: nick evans Date: Mon, 5 May 2025 15:22:03 -0400 Subject: [PATCH 5/5] =?UTF-8?q?=E2=9C=85=F0=9F=9A=A7=20Run=20CI=20with=20T?= =?UTF-8?q?ruffleRuby=20(experimental=20for=20now)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using truffleruby-head to ensure we have several necessary bugfixes. --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fcaa290c8..61fa67d04 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,6 +20,8 @@ jobs: ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }} os: [ ubuntu-latest, macos-latest, windows-latest ] experimental: [false] + include: + - { ruby: truffleruby-head, os: ubuntu-latest, experimental: true } runs-on: ${{ matrix.os }} continue-on-error: ${{ matrix.experimental }} timeout-minutes: 15