Skip to content

Commit 139bfb3

Browse files
committed
[test] Test against Rails 8.1
1 parent 7f4ccd9 commit 139bfb3

File tree

22 files changed

+357
-3
lines changed

22 files changed

+357
-3
lines changed

.github/workflows/maven.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ jobs:
6363
'rails71_rack22', 'rails71_rack31',
6464
'rails72_rack22', 'rails72_rack31',
6565
'rails80_rack22', 'rails80_rack31', 'rails80_rack32',
66+
'rails81_rack31', 'rails81_rack32',
6667
]
6768
jruby_version: [ '9.4.14.0', '10.0.3.0' ]
6869
java_version: [ '8', '11', '17', '21', '25' ]
@@ -79,6 +80,10 @@ jobs:
7980
jruby_version: '9.4.14.0' # Rails 8 requires Ruby 3.4 compatibility, which JRuby 9.4 does not support
8081
- appraisal: 'rails80_rack32'
8182
jruby_version: '9.4.14.0' # Rails 8 requires Ruby 3.4 compatibility, which JRuby 9.4 does not support
83+
- appraisal: 'rails81_rack31'
84+
jruby_version: '9.4.14.0' # Rails 8 requires Ruby 3.4 compatibility, which JRuby 9.4 does not support
85+
- appraisal: 'rails81_rack32'
86+
jruby_version: '9.4.14.0' # Rails 8 requires Ruby 3.4 compatibility, which JRuby 9.4 does not support
8287

8388
fail-fast: false
8489

Appraisals

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ version_spec = ->(prefix, desc) { "~> #{desc.split(prefix).last.insert(1, ".")}.
77
"rails71" => %w[rack22 rack31],
88
"rails72" => %w[rack22 rack31],
99
"rails80" => %w[rack22 rack31 rack32],
10+
"rails81" => %w[rack31 rack32],
1011
}.each do |rails_desc, rack_descs|
1112
rack_descs.each do |rack_desc|
1213

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ For more information on Rack, visit http://rack.github.io/.
1515

1616
| JRuby-Rack Series | Status | Rack | JRuby | Java | Rails | Target Servlet API | Notes |
1717
|----------------------------------------------------------------|---------------|-----------|------------|------|-----------|---------------------|----------------------------------------------------------------|
18-
| **2.0 (_planned_, _unreleased_)** | Dev | 2.2 → 3.2 | 9.4 → 10.0 | 8+ | 7.0 → 8.0 | 5.0+ (Jakarta EE 9) | ❌ Servlet < 5.0 containers will not work |
19-
| **1.3 (master, _unreleased_)** | Dev | 2.2 → 3.2 | 9.4 → 10.0 | 8+ | 7.0 → 8.0 | 4.0 (Java EE 8) |_Unofficial_: Servlet 2.5 → 3.1 & Rails 6.1 likely working |
18+
| **2.0 (_planned_, _unreleased_)** | Dev | 2.2 → 3.2 | 9.4 → 10.0 | 8+ | 7.0 → 8.1 | 5.0+ (Jakarta EE 9) | ❌ Servlet < 5.0 containers will not work |
19+
| **1.3 (master, _unreleased_)** | Dev | 2.2 → 3.2 | 9.4 → 10.0 | 8+ | 7.0 → 8.1 | 4.0 (Java EE 8) |_Unofficial_: Servlet 2.5 → 3.1 & Rails 6.1 likely working |
2020
| [**1.2**](https://github.com/jruby/jruby-rack/tree/1.2-stable) | Maintained | 2.2 | 9.3 → 9.4 | 8+ | 5.0 → 7.2 | 3.0 (Java EE 6) |_Unofficial_: Servlet 3.1 → 4.0 also OK with most containers |
2121
| [**1.1**](https://github.com/jruby/jruby-rack/tree/1.1-stable) | EOL @ 2024-05 | 1.x → 2.2 | 1.6 → 9.4 | 6+ | 2.1 → 5.2 | 2.5 (Java EE 5) |_Unofficial_: Servlet 3.0 → 4.0 also OK with most containers |
2222
| [**1.0**](https://github.com/jruby/jruby-rack/tree/1.0.10) | EOL @ 2011-11 | 0.9 → 1.x | 1.1 → 1.9 | 5+ | 2.1 → 3.x | 2.5 (Java EE 5) | |
@@ -357,7 +357,7 @@ package and push the .jar every time a commit changes a source file).
357357
```shell
358358
VERSION=rails72
359359
cd src/spec/stub
360-
rm -rf $VERSION && BUNDLE_GEMFILE=~/Projects/community/jruby-rack/gemfiles/${VERSION}_rack22.gemfile bundle exec rails new $VERSION --minimal --skip-git --skip-docker --skip-active-model --skip-active-record --skip-test --skip-system-test --skip-dev-gems --skip-bundle --skip-keeps --skip-asset-pipeline --skip-ci --skip-brakeman --skip-rubocop
360+
rm -rf $VERSION && BUNDLE_GEMFILE=~/Projects/community/jruby-rack/gemfiles/${VERSION}_rack32.gemfile bundle exec rails new $VERSION --minimal --skip-git --skip-docker --skip-active-model --skip-active-record --skip-test --skip-system-test --skip-dev-gems --skip-bundle --skip-keeps --skip-asset-pipeline --skip-ci --skip-brakeman --skip-rubocop
361361
```
362362
* Manual changes to make to support testing
363363
* In `config/production.rb` comment out the default `config.logger` value so jruby-rack applies its own `RailsLogger`.

gemfiles/rails81_rack31.gemfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "rake", "~> 13.3", group: :test, require: nil
6+
gem "rspec", group: :test
7+
8+
group :default do
9+
gem "rack", "~> 3.1.0"
10+
gem "rails", "~> 8.1.0"
11+
end
12+
13+
group :development do
14+
gem "appraisal", require: nil
15+
end

gemfiles/rails81_rack32.gemfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This file was generated by Appraisal
2+
3+
source "https://rubygems.org"
4+
5+
gem "rake", "~> 13.3", group: :test, require: nil
6+
gem "rspec", group: :test
7+
8+
group :default do
9+
gem "rack", "~> 3.2.0"
10+
gem "rails", "~> 8.1.0"
11+
end
12+
13+
group :development do
14+
gem "appraisal", require: nil
15+
end

src/spec/ruby/jruby/rack/integration_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,10 @@
220220
it_should_behave_like 'a rails app'
221221
end
222222

223+
describe 'rails 8.1', lib: :rails81 do
224+
it_should_behave_like 'a rails app'
225+
end
226+
223227
def expect_to_have_monkey_patched_chunked
224228
@runtime.evalScriptlet "require 'rack/chunked'"
225229
script = %{
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class ApplicationController < ActionController::Base
2+
# Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has.
3+
allow_browser versions: :modern
4+
end
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module ApplicationHelper
2+
end
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
require_relative "boot"
2+
3+
require "rails"
4+
# Pick the frameworks you want:
5+
require "active_model/railtie"
6+
# require "active_job/railtie"
7+
# require "active_record/railtie"
8+
# require "active_storage/engine"
9+
require "action_controller/railtie"
10+
# require "action_mailer/railtie"
11+
# require "action_mailbox/engine"
12+
# require "action_text/engine"
13+
require "action_view/railtie"
14+
# require "action_cable/engine"
15+
# require "rails/test_unit/railtie"
16+
17+
# Require the gems listed in Gemfile, including any gems
18+
# you've limited to :test, :development, or :production.
19+
Bundler.require(*Rails.groups)
20+
21+
module Rails81
22+
class Application < Rails::Application
23+
# Initialize configuration defaults for originally generated Rails version.
24+
config.load_defaults 8.1
25+
26+
# Please, add to the `ignore` list any other `lib` subdirectories that do
27+
# not contain `.rb` files, or that should not be reloaded or eager loaded.
28+
# Common ones are `templates`, `generators`, or `middleware`, for example.
29+
config.autoload_lib(ignore: %w[assets tasks])
30+
31+
# Configuration for the application, engines, and railties goes here.
32+
#
33+
# These settings can be overridden in specific environments using the files
34+
# in config/environments, which are processed later.
35+
#
36+
# config.time_zone = "Central Time (US & Canada)"
37+
# config.eager_load_paths << Rails.root.join("extras")
38+
39+
# Don't generate system test files.
40+
config.generators.system_tests = nil
41+
end
42+
end
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
2+
3+
require "bundler/setup" # Set up gems listed in the Gemfile.

0 commit comments

Comments
 (0)