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 against multiple Rails versions #647

Conversation

cjlarose
Copy link
Contributor

Before, we were running all tests against an older ActiveJob version (Rails 4.2). This change runs Rails-related tests against 4.2, 5.2, 6.0, and 6.1.

I'm interested in adding deeper integration tests for Rails applications and making some changes to how we interact with ActiveJob in order to support things like #646. Making it so that we run tests against many different Rails versions is an important prerequisite to guard against regressions.

The .gemfile files generated by `appraisal install` are checked-in to
git, but the .gemfile.lock files are ignored, matching appraisal's
recommendation.

The list of Rails versions was determined by Rails' [maintenance
policy][0], including everything in "severe security issues". In
addition, support for Rails 4.2 is included, despite it being EOL'd by
Rails. Removal of support for Rails 4.2 in shoryuken would be considered
a breaking change, so we'll keep support for now.

[0]: https://guides.rubyonrails.org/maintenance_policy.html
CI and appraisal can be used to run the suite against older versions. By
default, we want to run the suite against the latest released version.
Executing `bundle exec rake rails_specs` will run the subset of specs
that use ActiveJob. We'll run this suite against different versions of
Rails on CI.

Locally, devs can execute `bundle exec appraisal rake rails_specs` to
run the Rails suite against all supported versions of Rails.
On Travis, we'll run the Rails test suite against all supported versions
of Rails. In order to avoid running too many jobs in Travis, we only run
each Rails version against a single Ruby version. The Ruby version for
each suite was determined by latest stable version compatible with the
Rails version. The [compatibility matrix on the fastruby blog][0] is a
good reference for this.

[0]: https://www.fastruby.io/blog/ruby/rails/versions/compatibility-table.html
This version includes a handy `remove_gem` feature
This is to make it possible to remove the gem from some appraisals
On CI, we run Rails 4.2 against Ruby 2.2. Recent versions of pry-byebug
don't support Ruby 2.2 and getting old versions to run is tricky.
Instead, we just run the suite without the gem.
appraisal 2.2 is the latest version that still supports Ruby 2.2
@cjlarose cjlarose force-pushed the add-multiple-rails-versions-to-test-matrix branch from dee647d to 72c1e04 Compare January 26, 2021 18:25
@cjlarose cjlarose merged commit d960fbb into ruby-shoryuken:master Jan 27, 2021
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.

1 participant