Skip to content

Test installer#136

Open
zzak wants to merge 1 commit into
hotwired:mainfrom
zzak:test-installer
Open

Test installer#136
zzak wants to merge 1 commit into
hotwired:mainfrom
zzak:test-installer

Conversation

@zzak
Copy link
Copy Markdown

@zzak zzak commented Jan 11, 2024

This commit adds test coverage for the installer Rake task and application template. The installer is run 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.

Similar to rails/importmap-rails#206 for stimulus-rails

The motivation is to be able to move these tests from railties, see: rails/rails#49679

This commit adds test coverage for the installer Rake task and application template. The installer is run 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.

Similar to rails/importmap-rails#206 for stimulus-rails

The motivation is to be able to move these tests from railties, see: rails/rails#49679

Co-authored-by: Jonathan Hefner <jonathan@hefner.pro>
zzak added a commit to zzak/turbo-rails that referenced this pull request Jan 11, 2024
This commit adds test coverage for the installer Rake task and application template. The installer is run 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.

Similar to hotwired/stimulus-rails#136.

The motivation is to be able to move these tests from railties, see: rails/rails#49679

Co-authored-by: Jonathan Hefner <jonathan@hefner.pro>
zzak added a commit to zzak/turbo-rails that referenced this pull request Apr 19, 2024
This commit adds test coverage for the installer Rake task and application template. The installer is run 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.

Similar to hotwired/stimulus-rails#136.

The motivation is to be able to move these tests from railties, see: rails/rails#49679

Co-authored-by: Jonathan Hefner <jonathan@hefner.pro>
zzak added a commit to zzak/turbo-rails that referenced this pull request Nov 4, 2024
This commit adds test coverage for the installer Rake task and application template. The installer is run 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.

Similar to hotwired/stimulus-rails#136.

The motivation is to be able to move these tests from railties, see: rails/rails#49679

Co-authored-by: Jonathan Hefner <jonathan@hefner.pro>
dhh added a commit to hotwired/turbo-rails that referenced this pull request Mar 3, 2025
* Test installer

This commit adds test coverage for the installer Rake task and application template. The installer is run 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.

Similar to hotwired/stimulus-rails#136.

The motivation is to be able to move these tests from railties, see: rails/rails#49679

Co-authored-by: Jonathan Hefner <jonathan@hefner.pro>

* Monkey-patch AppName#valid_const? on older Rails (< 7.1)

My hunch is that this was fixed in Rails 7.1 by rails/rails#46074, but I'm less concerned here because this test suite uses a Dummy app for all of the tests.

This is a problem I've been working on in rails/rails#50427, to remove the dummy applications and replace them with a generated app like we've done here with the installer test.

I'm happy to investigate replacing the dummy app here afterwards.

* Make sure only supported sqlite3 gem is installed

```
LoadError: Error loading the 'sqlite3' Active Record adapter. Missing a gem it depends on? can't activate sqlite3 (~> 1.4), already activated sqlite3-2.0.0-x86_64-linux-gnu. Make sure all dependencies are added to Gemfile. (LoadError)

Caused by:
Gem::LoadError: can't activate sqlite3 (~> 1.4), already activated sqlite3-2.0.0-x86_64-linux-gnu. Make sure all dependencies are added to Gemfile. (Gem::LoadError)

Tasks: TOP => db:test:prepare => db:load_config
(See full trace by running task with --trace)
/home/zzak/.rbenv/versions/3.2.3/lib/ruby/gems/3.2.0/gems/bundler-2.5.4/lib/bundler/rubygems_integration.rb:237:in `block (2 levels) in replace_gem': Error loading the 'sqlite3' Active Record adapter. Missing a gem it depends on? can't activate sqlite3 (~> 1.4), already activated sqlite3-2.0.0-x86_64-linux-gnu. Make sure all dependencies are added to Gemfile. (LoadError)
```

* Fix installer test for Rails 6.1

---------

Co-authored-by: Jonathan Hefner <jonathan@hefner.pro>
Co-authored-by: David Heinemeier Hansson <david@hey.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant