Skip to content

Commit c4cd00e

Browse files
committed
[test] Test against Rails 8.1
1 parent cab297b commit c4cd00e

24 files changed

+413
-3
lines changed

.github/workflows/maven.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ jobs:
6464
'rails71_rack22', 'rails71_rack31',
6565
'rails72_rack22', 'rails72_rack31',
6666
'rails80_rack22', 'rails80_rack31', 'rails80_rack32',
67+
'rails81_rack31', 'rails81_rack32',
6768
]
6869
jruby_version: [ '9.4.14.0', '10.0.2.0' ]
6970
java_version: [ '8', '11', '17', '21' ]
@@ -80,6 +81,10 @@ jobs:
8081
jruby_version: '9.4.14.0' # Rails 8 requires Ruby 3.4 compatibility, which JRuby 9.4 does not support
8182
- appraisal: 'rails80_rack32'
8283
jruby_version: '9.4.14.0' # Rails 8 requires Ruby 3.4 compatibility, which JRuby 9.4 does not support
84+
- appraisal: 'rails81_rack31'
85+
jruby_version: '9.4.14.0' # Rails 8 requires Ruby 3.4 compatibility, which JRuby 9.4 does not support
86+
- appraisal: 'rails81_rack32'
87+
jruby_version: '9.4.14.0' # Rails 8 requires Ruby 3.4 compatibility, which JRuby 9.4 does not support
8388

8489
fail-fast: false
8590

Appraisals

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

README.md

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

1414
| JRuby-Rack Series | Status | Rack | JRuby | Java | Rails | Target Servlet API | Notes |
1515
|------------------------------------------------------------|------------|-----------|------------|------|-----------|---------------------|--------------------------------------------|
16-
| 2.0 (_planned_) | Dev | 2.2 → 3.2 | 9.4 → 10.0 | 8+ | 6.1 → 8.0 | 5.0+ (Jakarta EE 9) | Pre 5.0 servlet APIs non functional. |
17-
| 1.3 (master, _unreleased_) | Dev | 2.2 → 3.2 | 9.4 → 10.0 | 8+ | 6.1 → 8.0 | 4.0 (Java EE 8) | Servlet 2.5 → 3.1 likely to work fine. |
16+
| 2.0 (_planned_) | Dev | 2.2 → 3.2 | 9.4 → 10.0 | 8+ | 6.1 → 8.1 | 5.0+ (Jakarta EE 9) | Pre 5.0 servlet APIs non functional. |
17+
| 1.3 (master, _unreleased_) | Dev | 2.2 → 3.2 | 9.4 → 10.0 | 8+ | 6.1 → 8.1 | 4.0 (Java EE 8) | Servlet 2.5 → 3.1 likely to work fine. |
1818
| [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) | Servlet 3.1 → 4.0 OK with some containers. |
1919
| [1.1](https://github.com/jruby/jruby-rack/tree/1.1-stable) | EOL | 1.x → 2.2 | 1.6 → 9.4 | 6+ | 2.1 → 5.2 | 2.5 (Java EE 5) | Servlet 3.0 → 4.0 OK with some containers. |
2020
| 1.0 | EOL | 0.9 → 1.x | 1.1 → 1.9 | 5+ | 2.1 → 3.x | 2.5 (Java EE 5) | |
@@ -344,7 +344,7 @@ package and push the .jar every time a commit changes a source file).
344344
```shell
345345
VERSION=rails72
346346
cd src/spec/stub
347-
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
347+
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
348348
```
349349
* Manual changes to make to support testing
350350
* 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.beta"
10+
gem "rails", "~> 8.1.0.beta"
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.beta"
10+
gem "rails", "~> 8.1.0.beta"
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
@@ -224,6 +224,10 @@
224224
it_should_behave_like 'a rails app'
225225
end
226226

227+
describe 'rails 8.1', lib: :rails81 do
228+
it_should_behave_like 'a rails app'
229+
end
230+
227231
def expect_to_have_monkey_patched_chunked
228232
@runtime.evalScriptlet "require 'rack/chunked'"
229233
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)