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

[REQUEST] Add a dual-run command to run a single command with both versions #111

Open
arielj opened this issue Oct 4, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@arielj
Copy link

arielj commented Oct 4, 2023

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

@arielj arielj added the enhancement New feature or request label Oct 4, 2023
@arielj arielj self-assigned this Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant