From 8902d092d8222b381831e502a0f36ba6d1ef7dcf Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Thu, 8 Jul 2021 16:11:33 -0700 Subject: [PATCH 01/10] update tests to work with httprb 5.0+ --- test/multiverse/suites/httprb/httprb_test.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) From c3badc4b1c89ef4a64b49fdc34442b0f1a4669e9 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Thu, 8 Jul 2021 16:12:10 -0700 Subject: [PATCH 02/10] add httprb 5.0.0+ back to multiverse --- test/multiverse/suites/httprb/Envfile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test/multiverse/suites/httprb/Envfile b/test/multiverse/suites/httprb/Envfile index 8138b3b6a0..813a2f209a 100644 --- a/test/multiverse/suites/httprb/Envfile +++ b/test/multiverse/suites/httprb/Envfile @@ -4,12 +4,12 @@ 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 +gemfile <<-RB + gem 'http' # latest version + gem 'public_suffix', '< 3.0.0' if RUBY_VERSION < "2.1.0" + gem 'rack' + #{ruby3_gem_webrick} +RB # NOTE, some versions of HTTP gem implements body with # String.new("").force_encoding(@encoding) which won't work @@ -18,6 +18,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.0', 2.5], ['4.4.0', 2.3, 2.6], ['4.3.0', 2.3, 2.6], ['4.2.0', 2.3, 2.6], From d7929f273e4eef51b79d4710436915838019236f Mon Sep 17 00:00:00 2001 From: Kayla Reopelle Date: Fri, 27 Aug 2021 15:27:05 -0700 Subject: [PATCH 03/10] Update to latest Ruby and Ubuntu versions --- .github/workflows/ci.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3754763080..fb1a7d7854 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,10 +11,10 @@ on: jobs: build-ruby: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: matrix: - ruby-version: [2.2.10, 2.3.8, 2.4.10, 2.5.9, 2.6.8, 2.7.4, 3.0.2, jruby-9.2.17.0] + ruby-version: [2.2.10, 2.3.8, 2.4.10, 2.5.9, 2.6.8, 2.7.4, 3.0.2, jruby-9.2.19.0] steps: - uses: actions/checkout@v2 @@ -25,11 +25,11 @@ jobs: unit-tests: needs: build-ruby - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: - ruby-version: [2.2.10, 2.3.8, 2.4.10, 2.5.9, 2.6.8, 2.7.4, 3.0.2, jruby-9.2.17.0] + ruby-version: [2.2.10, 2.3.8, 2.4.10, 2.5.9, 2.6.8, 2.7.4, 3.0.2, jruby-9.2.19.0] steps: - uses: actions/checkout@v2 @@ -66,7 +66,7 @@ jobs: "3.0.2": { "rails": "norails" }, - "jruby-9.2.17.0": { + "jruby-9.2.19.0": { "rails": "norails,rails51,rails42" } } @@ -86,7 +86,7 @@ jobs: multiverse: needs: build-ruby - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 services: redis: image: redis @@ -153,7 +153,7 @@ jobs: infinite_tracing: needs: build-ruby - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: @@ -179,7 +179,7 @@ jobs: jruby_multiverse: needs: build-ruby - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 services: redis: image: redis @@ -221,10 +221,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Build Ruby jruby-9.2.17.0 + - name: Build Ruby jruby-9.2.19.0 uses: ./.github/actions/build-ruby with: - ruby-version: jruby-9.2.17.0 + ruby-version: jruby-9.2.19.0 - name: Start mysql run: sudo systemctl start mysql From 3140b2b45621efb04d0a65de900d3938bd384baa Mon Sep 17 00:00:00 2001 From: Kayla Reopelle Date: Fri, 27 Aug 2021 15:27:32 -0700 Subject: [PATCH 04/10] Remove condition for outdated JRuby version --- .../agent/stats_engine/stats_hash_test.rb | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) 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 From 194292421407c1cefd5e9e420a51135f30e0df0a Mon Sep 17 00:00:00 2001 From: "Kayla Reopelle (she/her)" <87386821+kaylareopelle@users.noreply.github.com> Date: Fri, 27 Aug 2021 16:28:18 -0700 Subject: [PATCH 05/10] Revert Ubuntu change --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fb1a7d7854..5b9b1af3ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ on: jobs: build-ruby: - runs-on: ubuntu-20.04 + runs-on: ubuntu-18.04 strategy: matrix: ruby-version: [2.2.10, 2.3.8, 2.4.10, 2.5.9, 2.6.8, 2.7.4, 3.0.2, jruby-9.2.19.0] @@ -25,7 +25,7 @@ jobs: unit-tests: needs: build-ruby - runs-on: ubuntu-20.04 + runs-on: ubuntu-18.04 strategy: fail-fast: false matrix: @@ -86,7 +86,7 @@ jobs: multiverse: needs: build-ruby - runs-on: ubuntu-20.04 + runs-on: ubuntu-18.04 services: redis: image: redis @@ -153,7 +153,7 @@ jobs: infinite_tracing: needs: build-ruby - runs-on: ubuntu-20.04 + runs-on: ubuntu-18.04 strategy: fail-fast: false matrix: @@ -179,7 +179,7 @@ jobs: jruby_multiverse: needs: build-ruby - runs-on: ubuntu-20.04 + runs-on: ubuntu-18.04 services: redis: image: redis From 0b9bfa2c5d5686f3e87f676403222f527755da63 Mon Sep 17 00:00:00 2001 From: Kayla Reopelle Date: Fri, 27 Aug 2021 17:00:34 -0700 Subject: [PATCH 06/10] Revert Ruby version bumps --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5b9b1af3ab..8478aa8870 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-18.04 strategy: matrix: - ruby-version: [2.2.10, 2.3.8, 2.4.10, 2.5.9, 2.6.8, 2.7.4, 3.0.2, jruby-9.2.19.0] + ruby-version: [2.2.10, 2.3.8, 2.4.10, 2.5.9, 2.6.7, 2.7.3, 3.0.1, jruby-9.2.19.0] steps: - uses: actions/checkout@v2 @@ -29,7 +29,7 @@ jobs: strategy: fail-fast: false matrix: - ruby-version: [2.2.10, 2.3.8, 2.4.10, 2.5.9, 2.6.8, 2.7.4, 3.0.2, jruby-9.2.19.0] + ruby-version: [2.2.10, 2.3.8, 2.4.10, 2.5.9, 2.6.7, 2.7.3, 3.0.1, jruby-9.2.19.0] steps: - uses: actions/checkout@v2 @@ -57,13 +57,13 @@ jobs: "2.5.9": { "rails": "norails,rails61,rails60,rails52,rails51,rails42,rails32" }, - "2.6.8": { + "2.6.7": { "rails": "norails,rails61,rails60,rails52,rails51,rails42" }, - "2.7.4": { + "2.7.3": { "rails": "norails,rails61,rails60" }, - "3.0.2": { + "3.0.1": { "rails": "norails" }, "jruby-9.2.19.0": { @@ -124,7 +124,7 @@ jobs: fail-fast: false matrix: multiverse: ["agent;background;background_2;database", "httpclients;httpclients_2", "frameworks;rails;rest"] - ruby-version: [2.2.10, 2.3.8, 2.4.10, 2.5.9, 2.6.8, 2.7.4, 3.0.2] + ruby-version: [2.2.10, 2.3.8, 2.4.10, 2.5.9, 2.6.7, 2.7.3, 3.0.1] steps: - uses: actions/checkout@v2 @@ -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.7, 2.7.3, 3.0.1] steps: - uses: actions/checkout@v2 From cfc750c7cc7fd7db53099eb8c4da24358be32f91 Mon Sep 17 00:00:00 2001 From: Aaron Huntsman Date: Thu, 9 Sep 2021 12:49:45 -0400 Subject: [PATCH 07/10] exclude jruby/httprb 5.0 from multiverse tests --- test/multiverse/suites/httprb/Envfile | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/test/multiverse/suites/httprb/Envfile b/test/multiverse/suites/httprb/Envfile index 813a2f209a..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,7 +20,7 @@ RB # Either just the gem version or Array of gem version and last and supported Ruby versions HTTPRB_VERSIONS = [ - ['5.0.0', 2.5], + ['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], @@ -29,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 From 4b8cd4f3200b9bd1754f4693de3720fd31757410 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Thu, 9 Sep 2021 14:45:19 -0700 Subject: [PATCH 08/10] updated CI to run same ruby versions for unit tests and multiverse --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 92b0d65d7c..a656e4a381 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,13 +57,13 @@ jobs: "2.5.9": { "rails": "norails,rails61,rails60,rails52,rails51,rails42,rails32" }, - "2.6.7": { + "2.6.8": { "rails": "norails,rails61,rails60,rails52,rails51,rails42" }, - "2.7.3": { + "2.7.4": { "rails": "norails,rails61,rails60" }, - "3.0.1": { + "3.0.2": { "rails": "norails" }, "jruby-9.2.19.0": { @@ -124,7 +124,7 @@ jobs: fail-fast: false matrix: multiverse: ["agent;background;background_2;database", "httpclients;httpclients_2", "frameworks;rails;rest"] - ruby-version: [2.2.10, 2.3.8, 2.4.10, 2.5.9, 2.6.7, 2.7.3, 3.0.1] + ruby-version: [2.2.10, 2.3.8, 2.4.10, 2.5.9, 2.6.8, 2.7.4, 3.0.2] steps: - uses: actions/checkout@v2 @@ -157,7 +157,7 @@ jobs: strategy: fail-fast: false matrix: - ruby-version: [2.5.9, 2.6.7, 2.7.3, 3.0.1] + ruby-version: [2.5.9, 8, 2.7.4, 3.0.2] steps: - uses: actions/checkout@v2 From 7dc2955f2a590f00e304457b1ed7419338944966 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Thu, 9 Sep 2021 14:46:04 -0700 Subject: [PATCH 09/10] fix ruby version in ci for infinite tracing tests --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a656e4a381..86f7457b23 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, 8, 2.7.4, 3.0.2] + ruby-version: [2.5.9, 2.3.8, 2.7.4, 3.0.2] steps: - uses: actions/checkout@v2 From f82181c0c25721ed4adb488e442e988e2ddb9619 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Thu, 9 Sep 2021 14:46:34 -0700 Subject: [PATCH 10/10] fix ruby version in ci --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86f7457b23..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.3.8, 2.7.4, 3.0.2] + ruby-version: [2.5.9, 2.6.8, 2.7.4, 3.0.2] steps: - uses: actions/checkout@v2