fastruby / next_rails

A toolkit to upgrade your next Rails application
https://www.fastruby.io/blog/upgrade-rails/dual-boot/dual-boot-with-rails-6-0-beta.html?utm_source=github&utm_medium=description&utm_campaign=github&utm_term=next-rails
MIT License
489 stars 31 forks source link

Add dual_run command #112

Closed arielj closed 1 week ago

arielj commented 1 year ago

Description

This PR fixes https://github.com/fastruby/next_rails/issues/111

We can now run the same command in the two versions in parallel, like: dual_run bundle exec rspec spec/models.

The output of that in a project would be this for example:

Running in parallel:
BUNDLE_GEMFILE=Gemfile.next bundle exec rspec spec/models/
bundle exec rspec spec/models/

next results
================================================================================

Randomized with seed 41263
...................

Finished in 0.25773 seconds (files took 4.02 seconds to load)
19 examples, 0 failures

Randomized with seed 41263

(waiting for current command to finish)
current results
================================================================================

Randomized with seed 40666
...................

Finished in 0.23505 seconds (files took 3.96 seconds to load)
19 examples, 0 failures

Randomized with seed 40666

Motivation and Context

This command solves 2 problems:

How Has This Been Tested?

To test this, you can add this branch as a gem in the Gemfile:

gem "next_rails", github: "fastruby/next_rails", branch: "add-dual-run-command"

Then bundle both:

bundle update next_rails
BUNDLE_GEMFILE=Gemfile.next bundle update next_rails

Now, in the root of the project, the dual_run command should be available:

dual_run bundle exec rspec spec/models

I'm not really sure how would I test this with automated tests.

I will abide by the code of conduct

JuanVqz commented 10 months ago

This seems useful, I'll have a look soon, thanks for contributing 🚀

Should we modify the changelog?

JuanVqz commented 10 months ago

@arielj, I followed How Has This Been Tested? steps to set it up but I got the following:

(venv) ➜  fastruby.io git:(BLOG-283) ✗ dual_run bundle exec rspec spec/models
zsh: command not found: dual_run
etagwerker commented 1 week ago

Closing it due to inactivity