next_rails
next_rails copied to clipboard
[REQUEST] Add a `dual-run` command to run a single command with both versions
Description
When using next rails, we can dual boot the app and run different commands either in the current or in the next version of gems.
This is fine but it's really common to need to run the same command in both versions to compare results and currently we have 2 options:
- run one after the other sequentially
- run them in different terminals in parallel
The cons of these 2 approaches are:
- when running sequentially, the time it takes to run everything is added, so if a test file takes 1 minute, running both to compare is 2 minutes. over time, these adds up to a lot of time waiting
- when running then in different terminals, we have to switch back and fort and manually execute/change commands on both sides
This feature request is about having a binary that would run one single command in the 2 versions in parallel in the same terminal and then print the output of both.
The benefits would be:
- saves time
- removes the context switching
Possible Implementation
What I imagine is a script that starts 2 threads. The output of the next
version can be streamed back to the main process, so the user can see that things are working. The output of the current
version can be captured and printed at the end when both threads finished so the outputs are not mixed.
I don't know what's the best command name, I said dual-run
but happy to change it to anything else.
Resources:
We have to be sure to use Ruby 2.0.0 features by default since we want to support that version. https://ruby-doc.org/core-2.0.0/Thread.html
And only use newer features if required for specific Ruby versions.
I will abide by the code of conduct