Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test installer commands #182

Merged
merged 6 commits into from
Jul 29, 2024
Merged

Test installer commands #182

merged 6 commits into from
Jul 29, 2024

Conversation

jonathanhefner
Copy link
Member

@jonathanhefner jonathanhefner commented Jan 10, 2024

This PR looks large because this project currently has no testing infrastructure. The vast majority of LOC in this PR are from Gemfile and Gemfile.lock files. I have split the PR into multiple commits to further clarify.


This adds test coverage for the javascript:install:bun, javascript:install:esbuild, javascript:install:rollup, and javascript:install:webpack commands. The commands are tested against a freshly generated Rails app using the version of Rails that is currently loaded. Thus the installer can be tested with different versions of Rails in CI.

Infrastructure has been added to run tests against Rails 7.0, 7.1, and main branch.

This PR takes a different approach than rails/dartsass-rails#49 — instead of separate appraisals / gemfiles for Sprockets and Propshaft, this PR has tests that target each.

This adds testing infrastructure to test against multiple versions of
Rails, including Rails `main` branch.
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.
This adds test coverage for specific behavior of the
`javascript:install:bun` command.
This adds test coverage for specific behavior of the
`javascript:install:esbuild` command.
This adds test coverage for specific behavior of the
`javascript:install:rollup` command.
This adds test coverage for specific behavior of the
`javascript:install:webpack` command.
Comment on lines -7 to +8
rails_version = ENV["RAILS_VERSION"] || "6.1.0"
gem "rails", "~> #{rails_version}"

gem "appraisal"
gem "rails", "~> 6.0.0"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file defaulted the Rails version to 6.1, but the gemspec specifies 6.0. Which is correct? (Or do we want to jump to Rails 7.0?)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we should retain compatibility with 6.0.

Comment on lines +8 to +15
ruby-version:
- "3.1"
- "3.2"
- "3.3"
gemfile:
- gemfiles/rails_7_0.gemfile
- gemfiles/rails_7_1.gemfile
- gemfiles/rails_main.gemfile
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only tests with Rails >= 7.0 and Ruby >= 3.1. I can add entries for Rails 6.0 and 6.1, and older versions of Ruby, but first I wanted to confirm which versions we want to support.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine to focus on these for now.

@dhh dhh merged commit 7054254 into rails:main Jul 29, 2024
dhh added a commit that referenced this pull request Jul 29, 2024
dhh added a commit that referenced this pull request Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants