Skip to content

Commit a4f2ac3

Browse files
committed
[test] Re-generate the rails72 sample test from scratch
Use a defined methodology to generate the stubs to make it easier to support new versions.
1 parent e3c81ce commit a4f2ac3

File tree

20 files changed

+148
-75
lines changed

20 files changed

+148
-75
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,20 @@ package and push the .jar every time a commit changes a source file).
348348
* mvn release:perform (possibly with -DuseReleaseProfile=false due to Javadoc doclint failures for now)
349349
* rake clean gem SKIP_SPECS=true and push the gem
350350

351+
## Adding testing for new Rails versions
352+
353+
* Add the new version to `.github/workflows/maven.yml` under the `matrix` section
354+
* Add a new configuration to the `Appraisals` file, then
355+
```bundle exec appraisal generate```
356+
* Generate a new stub Rails application for the new version
357+
```shell
358+
VERSION=rails72
359+
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
361+
```
362+
* Manual changes to make to support testing
363+
* In `config/production.rb` comment out the default `config.logger` value so jruby-rack applies its own `RailsLogger`.
364+
351365
## Support
352366

353367
Please use [github][4] to file bugs, patches and/or pull requests.

src/spec/stub/.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,21 @@
11
*/tmp
22
*/*.war
3+
4+
# Rails stub files we don't want
5+
rails*/Rakefile
6+
rails*/Gemfile
7+
rails*/Gemfile.lock
8+
rails*/bin
9+
rails*/README.md
10+
rails*/config.ru
11+
rails*/.ruby-version
12+
rails*/package.json
13+
14+
# Rails generates assets in samples that we don't really want
15+
rails*/**/*.ico
16+
rails*/**/*.png
17+
rails*/**/*.svg
18+
rails*/**/*.html
19+
rails*/**/*.erb
20+
rails*/**/*.js
21+
rails*/**/*.css
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
class ApplicationController < ActionController::API
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
24
end

src/spec/stub/rails72/app/controllers/concerns/.keep

Whitespace-only changes.

src/spec/stub/rails72/app/controllers/sample_controller.rb

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module ApplicationHelper
2+
end

src/spec/stub/rails72/app/helpers/sample_helper.rb

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/spec/stub/rails72/app/models/application_record.rb

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/spec/stub/rails72/app/models/concerns/.keep

Whitespace-only changes.

src/spec/stub/rails72/app/views/sample/index.html.erb

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)