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 #553

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Test installer #553

wants to merge 4 commits into from

Commits on Apr 19, 2024

  1. 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>
    zzak and jonathanhefner committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    d229a54 View commit details
    Browse the repository at this point in the history
  2. 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.
    zzak committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    63f3189 View commit details
    Browse the repository at this point in the history
  3. 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)
    ```
    zzak committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    20a460d View commit details
    Browse the repository at this point in the history
  4. Fix installer test for Rails 6.1

    zzak committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    ebca7f9 View commit details
    Browse the repository at this point in the history