diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5b9b1af3ab..e19a9daab5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -157,7 +157,7 @@ jobs: strategy: fail-fast: false matrix: - ruby-version: [2.5.9, 2.6.8, 2.7.4] + ruby-version: [2.5.9, 2.6.8, 2.7.4, 3.0.2] steps: - uses: actions/checkout@v2 diff --git a/test/multiverse/suites/httprb/Envfile b/test/multiverse/suites/httprb/Envfile index 8138b3b6a0..0e71d07a4c 100644 --- a/test/multiverse/suites/httprb/Envfile +++ b/test/multiverse/suites/httprb/Envfile @@ -4,12 +4,14 @@ end instrumentation_methods :chain, :prepend -# gemfile <<-RB -# gem 'http' # latest version -# gem 'public_suffix', '< 3.0.0' if RUBY_VERSION < "2.1.0" -# gem 'rack' -# #{ruby3_gem_webrick} -# RB +unless RUBY_PLATFORM == 'java' + gemfile <<-RB + gem 'http' # latest version + gem 'public_suffix', '< 3.0.0' if RUBY_VERSION < "2.1.0" + gem 'rack' + #{ruby3_gem_webrick} + RB +end # NOTE, some versions of HTTP gem implements body with # String.new("").force_encoding(@encoding) which won't work @@ -18,6 +20,7 @@ instrumentation_methods :chain, :prepend # Either just the gem version or Array of gem version and last and supported Ruby versions HTTPRB_VERSIONS = [ + ['5.0.1', 2.5], ['4.4.0', 2.3, 2.6], ['4.3.0', 2.3, 2.6], ['4.2.0', 2.3, 2.6], @@ -28,6 +31,7 @@ HTTPRB_VERSIONS = [ HTTPRB_VERSIONS.each do |httprb_version| if httprb_version.is_a?(Array) httprb_version, first_supported_ruby_version, last_supported_ruby_version = httprb_version + next if httprb_version =~ /^5.0/ && RUBY_PLATFORM == 'java' next if last_supported_ruby_version && RUBY_VERSION.to_f > last_supported_ruby_version next if RUBY_VERSION.to_f < first_supported_ruby_version end diff --git a/test/multiverse/suites/httprb/httprb_test.rb b/test/multiverse/suites/httprb/httprb_test.rb index 4c5716f61b..bd5685aac1 100644 --- a/test/multiverse/suites/httprb/httprb_test.rb +++ b/test/multiverse/suites/httprb/httprb_test.rb @@ -69,7 +69,8 @@ def response_instance(headers = {}) status: 200, version: '1.1', headers: headers, - body: '' + body: '', + request: HTTP::Request.new(uri: "http://newrelic.com", verb: :get) } httprb_resp = is_unsupported_1x? ? HTTP::Response.new(*options.values) : HTTP::Response.new(options) diff --git a/test/new_relic/agent/stats_engine/stats_hash_test.rb b/test/new_relic/agent/stats_engine/stats_hash_test.rb index f2c20939b4..051544f4cb 100644 --- a/test/new_relic/agent/stats_engine/stats_hash_test.rb +++ b/test/new_relic/agent/stats_engine/stats_hash_test.rb @@ -147,18 +147,14 @@ def test_merge_transaction_metrics assert_equal(1, hash[specs[3]].call_count) end - # Marshal.load is broken on current versions of Jruby, but it has been reported - # and will be fixed in JRuby 9.1.9.0. This conditional be removed after it's - # released. See: https://github.com/jruby/jruby/issues/4526. - if RUBY_ENGINE == 'ruby' || RUBY_ENGINE == 'jruby' && JRUBY_VERSION >= "9.1.9.0" - def test_marshal_dump - @hash.record(NewRelic::MetricSpec.new('foo'), 1) - @hash.record(NewRelic::MetricSpec.new('bar'), 2) - - copy = Marshal.load(Marshal.dump(@hash)) - assert_equal(@hash, copy) - assert_equal(@hash.started_at, copy.started_at) - end + + def test_marshal_dump + @hash.record(NewRelic::MetricSpec.new('foo'), 1) + @hash.record(NewRelic::MetricSpec.new('bar'), 2) + + copy = Marshal.load(Marshal.dump(@hash)) + assert_equal(@hash, copy) + assert_equal(@hash.started_at, copy.started_at) end # We can only fix up the default proc on Rubies that let us set it