diff --git a/.github/workflows/ci_cron.yml b/.github/workflows/ci_cron.yml index b9b4d82c31..5329d2588e 100644 --- a/.github/workflows/ci_cron.yml +++ b/.github/workflows/ci_cron.yml @@ -16,7 +16,7 @@ jobs: - name: Configure git run: 'git config --global init.defaultBranch main' - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag v3.5.0 - - uses: ruby/setup-ruby@bc1dd263b68cb5626dbb55d5c89777d79372c484 # tag v1.151.0 + - uses: ruby/setup-ruby@5311f05890856149502132d25c4a24985a00d426 # tag v1.153.0 with: ruby-version: '3.2' - run: bundle @@ -36,7 +36,7 @@ jobs: strategy: fail-fast: false matrix: - ruby-version: [2.4.10, 2.5.9, 2.6.10, 2.7.8, 3.0.6, 3.1.4, 3.2.2, 3.3.0-preview1] + ruby-version: [2.4.10, 2.5.9, 2.6.10, 2.7.8, 3.0.6, 3.1.4, 3.2.2, 3.3.0-preview2] steps: - name: Configure git @@ -50,7 +50,7 @@ jobs: run: sudo apt-get update; sudo apt-get install -y --no-install-recommends libcurl4-nss-dev libsasl2-dev libxslt1-dev - name: Install Ruby ${{ matrix.ruby-version }} - uses: ruby/setup-ruby@bc1dd263b68cb5626dbb55d5c89777d79372c484 # tag v1.151.0 + uses: ruby/setup-ruby@5311f05890856149502132d25c4a24985a00d426 # tag v1.153.0 with: ruby-version: ${{ matrix.ruby-version }} @@ -81,7 +81,7 @@ jobs: "3.2.2": { "rails": "norails,rails61,rails70,railsedge" }, - "3.3.0-preview1": { + "3.3.0-preview2": { "rails": "norails,rails61,rails70,railsedge" } } @@ -200,7 +200,7 @@ jobs: fail-fast: false matrix: multiverse: [agent, background, background_2, database, frameworks, httpclients, httpclients_2, rails, rest] - ruby-version: [2.4.10, 2.5.9, 2.6.10, 2.7.8, 3.0.6, 3.1.4, 3.2.2, 3.3.0-preview1] + ruby-version: [2.4.10, 2.5.9, 2.6.10, 2.7.8, 3.0.6, 3.1.4, 3.2.2, 3.3.0-preview2] steps: - name: Configure git run: 'git config --global init.defaultBranch main' @@ -213,7 +213,7 @@ jobs: run: sudo apt-get update; sudo apt-get install -y --no-install-recommends libcurl4-nss-dev libsasl2-dev libxslt1-dev - name: Install Ruby ${{ matrix.ruby-version }} - uses: ruby/setup-ruby@bc1dd263b68cb5626dbb55d5c89777d79372c484 # tag v1.151.0 + uses: ruby/setup-ruby@5311f05890856149502132d25c4a24985a00d426 # tag v1.153.0 with: ruby-version: ${{ matrix.ruby-version }} @@ -278,14 +278,14 @@ jobs: strategy: fail-fast: false matrix: - ruby-version: [2.5.9, 2.6.10, 2.7.8, 3.0.6, 3.1.4, 3.2.2, 3.3.0-preview1] + ruby-version: [2.5.9, 2.6.10, 2.7.8, 3.0.6, 3.1.4, 3.2.2, 3.3.0-preview2] steps: - name: Configure git run: 'git config --global init.defaultBranch main' - uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # tag v3.5.0 - name: Install Ruby ${{ matrix.ruby-version }} - uses: ruby/setup-ruby@bc1dd263b68cb5626dbb55d5c89777d79372c484 # tag v1.151.0 + uses: ruby/setup-ruby@5311f05890856149502132d25c4a24985a00d426 # tag v1.153.0 with: ruby-version: ${{ matrix.ruby-version }} diff --git a/test/multiverse/lib/multiverse/envfile.rb b/test/multiverse/lib/multiverse/envfile.rb index 4b1f139485..1cec6d1e12 100644 --- a/test/multiverse/lib/multiverse/envfile.rb +++ b/test/multiverse/lib/multiverse/envfile.rb @@ -18,6 +18,11 @@ def initialize(file_path, options = {}) @ignore_ruby_version = options[:ignore_ruby_version] if options.key?(:ignore_ruby_version) if File.exist?(file_path) @text = File.read(self.file_path) + # TODO: Test this behavior against Ruby 3.3.0 when it is out of preview + # to see if this behavior persists. Remove the gsub if not. + # With Ruby 3.3.0-preview2, eval() yields '(eval ...' as the String value + # when __FILE__ is used so swap out __FILE__ for the known agent root path + @text.gsub!('__FILE__', "'#{file_path}'") instance_eval(@text) end @gemfiles = [''] if @gemfiles.empty? diff --git a/test/new_relic/gemspec_files_test.rb b/test/new_relic/gemspec_files_test.rb index 2cb6be605d..6c0e28f7f9 100644 --- a/test/new_relic/gemspec_files_test.rb +++ b/test/new_relic/gemspec_files_test.rb @@ -10,9 +10,15 @@ def test_the_test_agent_helper_is_shipped_in_the_gem_files skip 'Gemspec test requires a newer version of Rubygems' unless Gem.respond_to?(:open_file) gem_spec_file_path = File.expand_path('../../../newrelic_rpm.gemspec', __FILE__) + gem_spec_content = Gem.open_file(gem_spec_file_path, 'r:UTF-8:-', &:read) + # TODO: Test this behavior against Ruby 3.3.0 when it is out of preview + # to see if this behavior persists. Remove the gsub if not. + # With Ruby 3.3.0-preview2, eval() yields '(eval ...' as the String value + # when __FILE__ is used so swap out __FILE__ for the known agent root path + gem_spec_content.gsub!('__FILE__', "'#{gem_spec_file_path}'") Dir.chdir(File.dirname(gem_spec_file_path)) do - gem_spec = eval(Gem.open_file(gem_spec_file_path, 'r:UTF-8:-', &:read)) + gem_spec = eval(gem_spec_content) assert gem_spec, "Failed to parse '#{gem_spec_file_path}'" assert_equal('newrelic_rpm', gem_spec.name)