Skip to content

Commit

Permalink
Merge pull request #217 from DataDog/anmarchenko/ruby_3.4
Browse files Browse the repository at this point in the history
[SDTEST-512] Add Ruby 3.4 to the testing matrix
  • Loading branch information
anmarchenko authored Aug 16, 2024
2 parents 1e85028 + 3070f3d commit 93dcfdc
Show file tree
Hide file tree
Showing 44 changed files with 4,136 additions and 60 deletions.
61 changes: 28 additions & 33 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,26 +232,6 @@ orbs:
- store_artifacts:
path: /tmp/workspace/coverage/report/
destination: coverage
changelog:
<<: *test_job_default
steps:
- restore_cache:
keys:
- '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundled-repo-<<parameters.ruby_version>>-{{ .Environment.CIRCLE_SHA1 }}'
- restore_cache:
keys:
- bundle-{{ .Environment.CIRCLE_CACHE_VERSION }}-{{ checksum ".circleci/images/primary/binary_version" }}-<<parameters.ruby_version>>-{{ checksum "lib/datadog/ci/version.rb" }}-{{ .Branch }}-{{ checksum ".circleci/bundle_checksum" }}
- attach_workspace:
at: /tmp/workspace
- run:
name: Format changelog
command: bundle exec rake changelog:format
- run:
name: Check if changelog was unformatted
command: |
if ! git diff-files --quiet; then
echo "Please run 'bundle exec rake changelog:format' and commit the results."
fi
commands:
docker-wait:
description: Wait for containers to listen on a TCP port.
Expand Down Expand Up @@ -299,10 +279,15 @@ job_configuration:
ruby_version: 'ruby-3.3'
image: ghcr.io/datadog/images-rb/engines/ruby:3.3
resource_class_to_use: medium+
- &config-3_2-small
<<: *config-3_2
resource_class_to_use: small
- &config-3_4
<<: *filters_all_branches_and_tags
ruby_version: 'ruby-3.4'
image: ghcr.io/datadog/images-rb/engines/ruby:3.4
resource_class_to_use: medium+
# ADD NEW RUBIES HERE
- &config-3_3-small
<<: *config-3_3
resource_class_to_use: small
- &config-jruby-9_4
<<: *filters_all_branches_and_tags
ruby_version: 'jruby-9.4'
Expand All @@ -314,29 +299,22 @@ workflows:
build-and-test:
jobs:
- orb/lint:
<<: *config-3_2-small
<<: *config-3_3-small
name: lint
requires:
- build-3.2
- orb/coverage:
<<: *config-3_2-small
<<: *config-3_3-small
name: coverage
requires:
- test-2.7
- test-3.0
- test-3.1
- test-3.2
- test-3.3
- test-3.4
# ADD NEW RUBIES HERE
- test-jruby-9.4
- orb/changelog:
<<: *config-3_2-small
name: changelog
requires:
- build-3.2
filters:
branches:
only: /bump_to_version_.*/
- orb/build:
<<: *config-2_7
name: build-2.7
Expand Down Expand Up @@ -377,6 +355,14 @@ workflows:
name: test-3.3
requires:
- build-3.3
- orb/build:
<<: *config-3_4
name: build-3.4
- orb/test:
<<: *config-3_4
name: test-3.4
requires:
- build-3.4
# ADD NEW RUBIES HERE
- orb/build:
<<: *config-jruby-9_4
Expand Down Expand Up @@ -441,6 +427,15 @@ workflows:
name: test-3.3
requires:
- build-3.3
- orb/build:
<<: *config-3_4
name: build-3.4
edge: true
- orb/test:
<<: *config-3_4
name: test-3.4
requires:
- build-3.4
# ADD NEW RUBIES HERE
- orb/build:
<<: *config-jruby-9_4
Expand Down
20 changes: 16 additions & 4 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ REMOVED_GEMS = {
check: %w[rbs steep],
development: %w[ruby-lsp ruby-lsp-rspec debug irb]
}
RUBY_VERSION = Gem::Version.new(RUBY_ENGINE_VERSION)

def appraise(group, &block)
# Specify the environment variable APPRAISAL_GROUP to load only a specific appraisal group.
Expand Down Expand Up @@ -54,6 +55,12 @@ def self.with_cucumber_gem(versions:)
if v == 9 && RUBY_ENGINE.include?("jruby")
gem "bigdecimal", "< 3.1.8"
end

# ruby 3.4 extracts more parts of stdlib into gems
if Gem::Version.new("3.4") <= RUBY_VERSION && !RUBY_ENGINE.include?("jruby") && (4..6).cover?(v)
gem "base64"
gem "mutex_m"
end
end
end
end
Expand Down Expand Up @@ -113,6 +120,12 @@ def self.with_active_support_gem(versions: 7)
if RUBY_ENGINE.include?("jruby")
gem "bigdecimal", "< 3.1.8"
end
# ruby 3.4 extracts more parts of stdlib into gems
if Gem::Version.new("3.4") <= RUBY_VERSION && !RUBY_ENGINE.include?("jruby") && (4..6).cover?(activesupport_v)
gem "base64"
gem "mutex_m"
gem "drb"
end
end
end
end
Expand Down Expand Up @@ -151,18 +164,17 @@ def self.with_timecop_gem(timecop_versions: 0)
end
end

ruby_version = Gem::Version.new(RUBY_ENGINE_VERSION)
major, minor, = ruby_version.segments
major, minor, = RUBY_VERSION.segments

with_minitest_gem
with_rspec_gem
with_cucumber_gem(versions: 3..9)
with_ci_queue_minitest_gem
with_ci_queue_rspec_gem
with_minitest_shoulda_context_gem if ruby_version >= Gem::Version.new("3.1")
with_minitest_shoulda_context_gem if Gem::Version.new("3.1") <= RUBY_VERSION
with_active_support_gem(versions: 4..7)
with_knapsack_pro_rspec_gem
with_selenium_gem if ruby_version >= Gem::Version.new("3.0")
with_selenium_gem if Gem::Version.new("3.0") <= RUBY_VERSION
with_timecop_gem

ruby_runtime = "#{RUBY_ENGINE}-#{major}.#{minor}"
Expand Down
1 change: 1 addition & 0 deletions Gemfile-3.4
45 changes: 23 additions & 22 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,54 +22,55 @@ YARD::Rake::YardocTask.new(:docs) do |t|
t.options += ["--title", "datadog-ci #{Datadog::CI::VERSION} documentation"]
end

# ADD NEW RUBIES HERE
TEST_METADATA = {
"main" => {
"" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby"
"" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ 3.4 / ✅ jruby"
},
"git" => {
"" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby"
"" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby"
},
"cucumber" => {
"cucumber-3" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby",
"cucumber-4" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby",
"cucumber-5" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby",
"cucumber-6" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby",
"cucumber-7" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby",
"cucumber-8" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby",
"cucumber-9" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby"
"cucumber-3" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby",
"cucumber-4" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby",
"cucumber-5" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby",
"cucumber-6" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby",
"cucumber-7" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby",
"cucumber-8" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby",
"cucumber-9" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby"
},
"rspec" => {
"rspec-3" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby"
"rspec-3" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby"
},
"minitest" => {
"minitest-5" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby"
"minitest-5" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby"
},
"activesupport" => {
"activesupport-4" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby",
"activesupport-5" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby",
"activesupport-6" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby",
"activesupport-7" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby"
"activesupport-4" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby",
"activesupport-5" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby",
"activesupport-6" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby",
"activesupport-7" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby"
},
"ci_queue_minitest" => {
"ci-queue-0-minitest-5" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby"
"ci-queue-0-minitest-5" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby"
},
"ci_queue_rspec" => {
"ci-queue-0-rspec-3" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby"
"ci-queue-0-rspec-3" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby"
},
"minitest_shoulda_context" => {
"minitest-5-shoulda-context-2-shoulda-matchers-6" => "❌ 2.7 / ❌ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby"
"minitest-5-shoulda-context-2-shoulda-matchers-6" => "❌ 2.7 / ❌ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby"
},
"knapsack_rspec" => {
"knapsack_pro-7-rspec-3" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ❌ jruby"
"knapsack_pro-7-rspec-3" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ❌ jruby"
},
"knapsack_rspec_go" => {
"knapsack_pro-7-rspec-3" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ❌ jruby"
"knapsack_pro-7-rspec-3" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ❌ jruby"
},
"selenium" => {
"selenium-4-capybara-3" => "❌ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby"
"selenium-4-capybara-3" => "❌ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby"
},
"timecop" => {
"timecop-0" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ jruby"
"timecop-0" => "✅ 2.7 / ✅ 3.0 / ✅ 3.1 / ✅ 3.2 / ✅ 3.3 / ✅ 3.4 / ✅ jruby"
}
}

Expand Down
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@ services:
volumes:
- .:/app
- bundle-3.3:/usr/local/bundle
datadog-ci-3.4:
image: ghcr.io/datadog/images-rb/engines/ruby:3.4
working_dir: /app
command: /bin/bash
env_file: ./.env
environment:
BUNDLE_GEMFILE: /app/Gemfile-3.4
stdin_open: true
tty: true
volumes:
- .:/app
- bundle-3.4:/usr/local/bundle
# ADD NEW RUBIES HERE
datadog-ci-jruby-9.4:
image: ghcr.io/datadog/images-rb/engines/jruby:9.4
Expand All @@ -79,4 +91,5 @@ volumes:
bundle-3.1:
bundle-3.2:
bundle-3.3:
bundle-3.4:
bundle-jruby-9.4: # ADD NEW RUBIES HERE
35 changes: 35 additions & 0 deletions gemfiles/ruby_3.4_activesupport_4.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "pry"
gem "rake"
gem "standard", "~> 1.31"
gem "rake-compiler"
gem "rspec"
gem "rspec-collection_matchers"
gem "rspec_junit_formatter"
gem "climate_control"
gem "appraisal"
gem "webmock"
gem "os"
gem "yard"
gem "redcarpet"
gem "webrick"
gem "pimpmychangelog", ">= 0.1.2"
gem "simplecov"
gem "simplecov-cobertura", "~> 2.1.0"
gem "activesupport", "~> 4"
gem "base64"
gem "mutex_m"
gem "drb"

group :check do

end

group :development do

end

gemspec path: "../"
Loading

0 comments on commit 93dcfdc

Please sign in to comment.