Skip to content

Commit 7054254

Browse files
Test installer commands (#182)
* Add testing infrastructure This adds testing infrastructure to test against multiple versions of Rails, including Rails `main` branch. * Test shared behavior of installer commands This adds test coverage for the shared behavior of the installer commands. The commands are tested against a freshly generated Rails app using the version of Rails that is currently loaded. Thus the installers can be tested with different versions of Rails in CI. * Test specific behavior of javascript:install:bun This adds test coverage for specific behavior of the `javascript:install:bun` command. * Test specific behavior of javascript:install:esbuild This adds test coverage for specific behavior of the `javascript:install:esbuild` command. * Test specific behavior of javascript:install:rollup This adds test coverage for specific behavior of the `javascript:install:rollup` command. * Test specific behavior of javascript:install:webpack This adds test coverage for specific behavior of the `javascript:install:webpack` command.
1 parent 38fbbae commit 7054254

17 files changed

+1066
-116
lines changed

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CI
2+
on: [push, pull_request]
3+
jobs:
4+
tests:
5+
strategy:
6+
fail-fast: false
7+
matrix:
8+
ruby-version:
9+
- "3.1"
10+
- "3.2"
11+
- "3.3"
12+
gemfile:
13+
- gemfiles/rails_7_0.gemfile
14+
- gemfiles/rails_7_1.gemfile
15+
- gemfiles/rails_main.gemfile
16+
continue-on-error: [ false ]
17+
18+
name: ${{ format('Tests (Ruby {0}, {1})', matrix.ruby-version, matrix.gemfile) }}
19+
runs-on: ubuntu-latest
20+
continue-on-error: ${{ matrix.continue-on-error }}
21+
22+
env:
23+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- name: Remove Gemfile lock
29+
run: |
30+
rm -f $BUNDLE_GEMFILE.lock
31+
32+
- name: Install Ruby
33+
uses: ruby/setup-ruby@v1
34+
with:
35+
ruby-version: ${{ matrix.ruby-version }}
36+
bundler-cache: true
37+
38+
- name: Run tests
39+
run: |
40+
bundle exec rake

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1+
/tmp/
12
.byebug_history
23
*.gem
4+
5+
# Ignore Gemfile.lock files for Rails main branch.
6+
/gemfiles/rails_main*.gemfile.lock

Appraisals

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
appraise "rails_7_0" do
2+
gem "rails", "~> 7.0.0"
3+
gem "propshaft"
4+
end
5+
6+
appraise "rails_7_1" do
7+
gem "rails", "~> 7.1.0"
8+
gem "propshaft"
9+
end
10+
11+
appraise "rails_main" do
12+
gem "rails", github: "rails/rails", branch: "main"
13+
gem "propshaft"
14+
end

Gemfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
44
# Specify your gem's dependencies in importmap-rails.gemspec.
55
gemspec
66

7-
rails_version = ENV["RAILS_VERSION"] || "6.1.0"
8-
gem "rails", "~> #{rails_version}"
9-
7+
gem "appraisal"
8+
gem "rails", "~> 6.0.0"
9+
gem "sprockets-rails"
1010
gem "sqlite3"
1111

1212
group :test do

Gemfile.lock

Lines changed: 144 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -7,162 +7,191 @@ PATH
77
GEM
88
remote: https://rubygems.org/
99
specs:
10-
actioncable (6.1.3.1)
11-
actionpack (= 6.1.3.1)
12-
activesupport (= 6.1.3.1)
10+
actioncable (6.0.6.1)
11+
actionpack (= 6.0.6.1)
1312
nio4r (~> 2.0)
1413
websocket-driver (>= 0.6.1)
15-
actionmailbox (6.1.3.1)
16-
actionpack (= 6.1.3.1)
17-
activejob (= 6.1.3.1)
18-
activerecord (= 6.1.3.1)
19-
activestorage (= 6.1.3.1)
20-
activesupport (= 6.1.3.1)
14+
actionmailbox (6.0.6.1)
15+
actionpack (= 6.0.6.1)
16+
activejob (= 6.0.6.1)
17+
activerecord (= 6.0.6.1)
18+
activestorage (= 6.0.6.1)
19+
activesupport (= 6.0.6.1)
2120
mail (>= 2.7.1)
22-
actionmailer (6.1.3.1)
23-
actionpack (= 6.1.3.1)
24-
actionview (= 6.1.3.1)
25-
activejob (= 6.1.3.1)
26-
activesupport (= 6.1.3.1)
21+
actionmailer (6.0.6.1)
22+
actionpack (= 6.0.6.1)
23+
actionview (= 6.0.6.1)
24+
activejob (= 6.0.6.1)
2725
mail (~> 2.5, >= 2.5.4)
2826
rails-dom-testing (~> 2.0)
29-
actionpack (6.1.3.1)
30-
actionview (= 6.1.3.1)
31-
activesupport (= 6.1.3.1)
32-
rack (~> 2.0, >= 2.0.9)
27+
actionpack (6.0.6.1)
28+
actionview (= 6.0.6.1)
29+
activesupport (= 6.0.6.1)
30+
rack (~> 2.0, >= 2.0.8)
3331
rack-test (>= 0.6.3)
3432
rails-dom-testing (~> 2.0)
3533
rails-html-sanitizer (~> 1.0, >= 1.2.0)
36-
actiontext (6.1.3.1)
37-
actionpack (= 6.1.3.1)
38-
activerecord (= 6.1.3.1)
39-
activestorage (= 6.1.3.1)
40-
activesupport (= 6.1.3.1)
34+
actiontext (6.0.6.1)
35+
actionpack (= 6.0.6.1)
36+
activerecord (= 6.0.6.1)
37+
activestorage (= 6.0.6.1)
38+
activesupport (= 6.0.6.1)
4139
nokogiri (>= 1.8.5)
42-
actionview (6.1.3.1)
43-
activesupport (= 6.1.3.1)
40+
actionview (6.0.6.1)
41+
activesupport (= 6.0.6.1)
4442
builder (~> 3.1)
4543
erubi (~> 1.4)
4644
rails-dom-testing (~> 2.0)
4745
rails-html-sanitizer (~> 1.1, >= 1.2.0)
48-
activejob (6.1.3.1)
49-
activesupport (= 6.1.3.1)
46+
activejob (6.0.6.1)
47+
activesupport (= 6.0.6.1)
5048
globalid (>= 0.3.6)
51-
activemodel (6.1.3.1)
52-
activesupport (= 6.1.3.1)
53-
activerecord (6.1.3.1)
54-
activemodel (= 6.1.3.1)
55-
activesupport (= 6.1.3.1)
56-
activestorage (6.1.3.1)
57-
actionpack (= 6.1.3.1)
58-
activejob (= 6.1.3.1)
59-
activerecord (= 6.1.3.1)
60-
activesupport (= 6.1.3.1)
61-
marcel (~> 1.0.0)
62-
mini_mime (~> 1.0.2)
63-
activesupport (6.1.3.1)
49+
activemodel (6.0.6.1)
50+
activesupport (= 6.0.6.1)
51+
activerecord (6.0.6.1)
52+
activemodel (= 6.0.6.1)
53+
activesupport (= 6.0.6.1)
54+
activestorage (6.0.6.1)
55+
actionpack (= 6.0.6.1)
56+
activejob (= 6.0.6.1)
57+
activerecord (= 6.0.6.1)
58+
marcel (~> 1.0)
59+
activesupport (6.0.6.1)
6460
concurrent-ruby (~> 1.0, >= 1.0.2)
65-
i18n (>= 1.6, < 2)
66-
minitest (>= 5.1)
67-
tzinfo (~> 2.0)
68-
zeitwerk (~> 2.3)
69-
addressable (2.8.0)
70-
public_suffix (>= 2.0.2, < 5.0)
61+
i18n (>= 0.7, < 2)
62+
minitest (~> 5.1)
63+
tzinfo (~> 1.1)
64+
zeitwerk (~> 2.2, >= 2.2.2)
65+
addressable (2.8.6)
66+
public_suffix (>= 2.0.2, < 6.0)
67+
appraisal (2.5.0)
68+
bundler
69+
rake
70+
thor (>= 0.14.0)
7171
builder (3.2.4)
7272
byebug (11.1.3)
73-
capybara (3.35.3)
73+
capybara (3.39.2)
7474
addressable
75+
matrix
7576
mini_mime (>= 0.1.3)
7677
nokogiri (~> 1.8)
7778
rack (>= 1.6.0)
7879
rack-test (>= 0.6.3)
7980
regexp_parser (>= 1.5, < 3.0)
8081
xpath (~> 3.2)
81-
childprocess (3.0.0)
82-
concurrent-ruby (1.1.9)
82+
concurrent-ruby (1.2.2)
8383
crass (1.0.6)
84-
erubi (1.10.0)
85-
globalid (0.5.1)
84+
date (3.3.4)
85+
erubi (1.12.0)
86+
globalid (1.1.0)
8687
activesupport (>= 5.0)
87-
i18n (1.8.10)
88+
i18n (1.14.1)
8889
concurrent-ruby (~> 1.0)
89-
loofah (2.10.0)
90+
loofah (2.22.0)
9091
crass (~> 1.0.2)
91-
nokogiri (>= 1.5.9)
92-
mail (2.7.1)
92+
nokogiri (>= 1.12.0)
93+
mail (2.8.1)
9394
mini_mime (>= 0.1.1)
94-
marcel (1.0.1)
95+
net-imap
96+
net-pop
97+
net-smtp
98+
marcel (1.0.2)
99+
matrix (0.4.2)
95100
method_source (1.0.0)
96-
mini_mime (1.0.3)
97-
mini_portile2 (2.8.2)
98-
minitest (5.14.4)
99-
nio4r (2.5.7)
100-
nokogiri (1.13.6)
101-
mini_portile2 (~> 2.8.0)
101+
mini_mime (1.1.5)
102+
minitest (5.20.0)
103+
net-imap (0.4.9.1)
104+
date
105+
net-protocol
106+
net-pop (0.1.2)
107+
net-protocol
108+
net-protocol (0.2.2)
109+
timeout
110+
net-smtp (0.4.0.1)
111+
net-protocol
112+
nio4r (2.7.0)
113+
nokogiri (1.16.0-aarch64-linux)
102114
racc (~> 1.4)
103-
public_suffix (4.0.6)
104-
racc (1.5.2)
105-
rack (2.2.3)
106-
rack-test (1.1.0)
107-
rack (>= 1.0, < 3)
108-
rails (6.1.3.1)
109-
actioncable (= 6.1.3.1)
110-
actionmailbox (= 6.1.3.1)
111-
actionmailer (= 6.1.3.1)
112-
actionpack (= 6.1.3.1)
113-
actiontext (= 6.1.3.1)
114-
actionview (= 6.1.3.1)
115-
activejob (= 6.1.3.1)
116-
activemodel (= 6.1.3.1)
117-
activerecord (= 6.1.3.1)
118-
activestorage (= 6.1.3.1)
119-
activesupport (= 6.1.3.1)
120-
bundler (>= 1.15.0)
121-
railties (= 6.1.3.1)
115+
nokogiri (1.16.0-arm64-darwin)
116+
racc (~> 1.4)
117+
nokogiri (1.16.0-x86_64-darwin)
118+
racc (~> 1.4)
119+
nokogiri (1.16.0-x86_64-linux)
120+
racc (~> 1.4)
121+
public_suffix (5.0.4)
122+
racc (1.7.3)
123+
rack (2.2.8)
124+
rack-test (2.1.0)
125+
rack (>= 1.3)
126+
rails (6.0.6.1)
127+
actioncable (= 6.0.6.1)
128+
actionmailbox (= 6.0.6.1)
129+
actionmailer (= 6.0.6.1)
130+
actionpack (= 6.0.6.1)
131+
actiontext (= 6.0.6.1)
132+
actionview (= 6.0.6.1)
133+
activejob (= 6.0.6.1)
134+
activemodel (= 6.0.6.1)
135+
activerecord (= 6.0.6.1)
136+
activestorage (= 6.0.6.1)
137+
activesupport (= 6.0.6.1)
138+
bundler (>= 1.3.0)
139+
railties (= 6.0.6.1)
122140
sprockets-rails (>= 2.0.0)
123-
rails-dom-testing (2.0.3)
124-
activesupport (>= 4.2.0)
141+
rails-dom-testing (2.2.0)
142+
activesupport (>= 5.0.0)
143+
minitest
125144
nokogiri (>= 1.6)
126-
rails-html-sanitizer (1.3.0)
127-
loofah (~> 2.3)
128-
railties (6.1.3.1)
129-
actionpack (= 6.1.3.1)
130-
activesupport (= 6.1.3.1)
145+
rails-html-sanitizer (1.6.0)
146+
loofah (~> 2.21)
147+
nokogiri (~> 1.14)
148+
railties (6.0.6.1)
149+
actionpack (= 6.0.6.1)
150+
activesupport (= 6.0.6.1)
131151
method_source
132152
rake (>= 0.8.7)
133-
thor (~> 1.0)
134-
rake (13.0.6)
135-
regexp_parser (2.1.1)
136-
rexml (3.2.5)
153+
thor (>= 0.20.3, < 2.0)
154+
rake (13.1.0)
155+
regexp_parser (2.9.0)
156+
rexml (3.2.6)
137157
rubyzip (2.3.2)
138-
selenium-webdriver (3.142.7)
139-
childprocess (>= 0.5, < 4.0)
140-
rubyzip (>= 1.2.2)
141-
sprockets (4.0.2)
158+
selenium-webdriver (4.10.0)
159+
rexml (~> 3.2, >= 3.2.5)
160+
rubyzip (>= 1.2.2, < 3.0)
161+
websocket (~> 1.0)
162+
sprockets (4.2.1)
142163
concurrent-ruby (~> 1.0)
143-
rack (> 1, < 3)
144-
sprockets-rails (3.2.2)
145-
actionpack (>= 4.0)
146-
activesupport (>= 4.0)
164+
rack (>= 2.2.4, < 4)
165+
sprockets-rails (3.4.2)
166+
actionpack (>= 5.2)
167+
activesupport (>= 5.2)
147168
sprockets (>= 3.0.0)
148-
sqlite3 (1.4.2)
149-
stimulus-rails (0.3.8)
150-
rails (>= 6.0.0)
151-
thor (1.1.0)
152-
turbo-rails (0.7.4)
153-
rails (>= 6.0.0)
154-
tzinfo (2.0.4)
155-
concurrent-ruby (~> 1.0)
156-
webdrivers (4.6.0)
169+
sqlite3 (1.7.0-aarch64-linux)
170+
sqlite3 (1.7.0-arm64-darwin)
171+
sqlite3 (1.7.0-x86_64-darwin)
172+
sqlite3 (1.7.0-x86_64-linux)
173+
stimulus-rails (1.3.3)
174+
railties (>= 6.0.0)
175+
thor (1.3.0)
176+
thread_safe (0.3.6)
177+
timeout (0.4.1)
178+
turbo-rails (1.5.0)
179+
actionpack (>= 6.0.0)
180+
activejob (>= 6.0.0)
181+
railties (>= 6.0.0)
182+
tzinfo (1.2.11)
183+
thread_safe (~> 0.1)
184+
webdrivers (5.3.1)
157185
nokogiri (~> 1.6)
158186
rubyzip (>= 1.3.0)
159-
selenium-webdriver (>= 3.0, < 4.0)
160-
websocket-driver (0.7.5)
187+
selenium-webdriver (~> 4.0, < 4.11)
188+
websocket (1.2.10)
189+
websocket-driver (0.7.6)
161190
websocket-extensions (>= 0.1.0)
162191
websocket-extensions (0.1.5)
163192
xpath (3.2.0)
164193
nokogiri (~> 1.8)
165-
zeitwerk (2.4.2)
194+
zeitwerk (2.6.12)
166195

167196
PLATFORMS
168197
aarch64-linux
@@ -174,12 +203,14 @@ PLATFORMS
174203
x86_64-linux
175204

176205
DEPENDENCIES
206+
appraisal
177207
byebug
178208
capybara
179209
jsbundling-rails!
180-
rails (~> 6.1.0)
210+
rails (~> 6.0.0)
181211
rexml
182212
selenium-webdriver
213+
sprockets-rails
183214
sqlite3
184215
stimulus-rails
185216
turbo-rails

0 commit comments

Comments
 (0)