My Stuff

Ruby on Rails Upgrade Phase 3: Running test suite

Now that the app is able to boot in both versions we can look at Phase 3 of the upgrade process. This phase can be a bit confusing in its details, the key is to remember that the goal is a running test suite and not a full passing test suite. A fully passing test suite is the next phase. The details of how this phase works could look like this:

Goal: Running test suite with failures that fail on the next version marked as pending. Once merged any new code will have to work in both versions.

Steps:

  1. Create a “CI running tests on both versions” story and plan according to your process.
  2. Once you start on the story: Create a branch for it
  3. Attempt to Get the specs running on the new version (It is okay if there are failures as long as the test suite is running)
    • eg RAILS_ENV=test BUNDLE_GEMFILE=Gemfile-next bundle exec rspec
    • Attempt to resolve any minor issues immediately that are related to getting the tests running
    • Create new refactor stories as required for getting the tests running
  4. If you created new refactor stories
    • Merge as much as you can into the main branch
    • mark the main story as attempted/done/finish/etc
    • plan the new refactor stories according to your process
    • once new stories are done, start from Step 1 again
  5. Run the specs on CI
  6. add a “pending_on_upgrade” helper (pending “fix for rails upgrade” if Rails.version > “4.2”)
  7. Once CI is complete, mark all tests that fail on the next version using the “pending_on_upgrade” helper
  8. remove app boot test on CI (Not needed anymore because tests are running)
  9. Wait for a green build
  10. Add the changes to version control
  11. Share with the team that any new tests need to work on both versions
  12. Merge the branch into master

And that is it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s