Skip to content

Commit

Permalink
Merge pull request #2224 from newrelic/ruby330preview2
Browse files Browse the repository at this point in the history
CI: Ruby 3.3.0-preview1 -> preview2
  • Loading branch information
fallwith authored Sep 19, 2023
2 parents ad0165b + bf5bfc9 commit 2a86256
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/ci_cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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 }}

Expand Down Expand Up @@ -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"
}
}
Expand Down Expand Up @@ -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'
Expand All @@ -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 }}

Expand Down Expand Up @@ -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 }}

Expand Down
5 changes: 5 additions & 0 deletions test/multiverse/lib/multiverse/envfile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
8 changes: 7 additions & 1 deletion test/new_relic/gemspec_files_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2a86256

Please sign in to comment.