-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test installer commands (retry) (#197)
* 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.
- Loading branch information
1 parent
6ead108
commit 2413e21
Showing
19 changed files
with
1,196 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: CI | ||
on: [push, pull_request] | ||
jobs: | ||
tests: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
ruby-version: | ||
- "3.1" | ||
- "3.2" | ||
- "3.3" | ||
gemfile: | ||
- gemfiles/rails_6_1.gemfile | ||
- gemfiles/rails_7_0.gemfile | ||
- gemfiles/rails_7_1.gemfile | ||
- gemfiles/rails_main.gemfile | ||
continue-on-error: [ false ] | ||
|
||
name: ${{ format('Tests (Ruby {0}, {1})', matrix.ruby-version, matrix.gemfile) }} | ||
runs-on: ubuntu-latest | ||
continue-on-error: ${{ matrix.continue-on-error }} | ||
|
||
env: | ||
BUNDLE_GEMFILE: ${{ matrix.gemfile }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Remove Gemfile lock | ||
run: | | ||
rm -f $BUNDLE_GEMFILE.lock | ||
- name: Install Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.ruby-version }} | ||
bundler-cache: true | ||
|
||
- name: Run tests | ||
run: | | ||
bundle exec rake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
/tmp/ | ||
.byebug_history | ||
*.gem | ||
|
||
# Ignore Gemfile.lock files for Rails main branch. | ||
/gemfiles/rails_main*.gemfile.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
appraise "rails_6_1" do | ||
gem "rails", "~> 6.1.0" | ||
end | ||
|
||
appraise "rails_7_0" do | ||
gem "rails", "~> 7.0.0" | ||
gem "propshaft" | ||
end | ||
|
||
appraise "rails_7_1" do | ||
gem "rails", "~> 7.1.0" | ||
gem "propshaft" | ||
end | ||
|
||
appraise "rails_main" do | ||
gem "rails", github: "rails/rails", branch: "main" | ||
gem "propshaft" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
require "bundler/setup" | ||
require "bundler/gem_tasks" | ||
require "rake/testtask" | ||
|
||
Rake::TestTask.new(:test) do |t| | ||
t.libs << "test" | ||
t.pattern = "test/**/*_test.rb" | ||
end | ||
|
||
task default: :test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# This file was generated by Appraisal | ||
|
||
source "https://rubygems.org" | ||
|
||
gem "appraisal" | ||
gem "rails", "~> 6.1.0" | ||
gem "sprockets-rails" | ||
gem "sqlite3" | ||
|
||
group :test do | ||
gem "turbo-rails" | ||
gem "stimulus-rails" | ||
gem "byebug" | ||
gem "rexml" | ||
gem "capybara" | ||
gem "selenium-webdriver" | ||
gem "webdrivers" | ||
end | ||
|
||
gemspec path: "../" |
Oops, something went wrong.