-
Notifications
You must be signed in to change notification settings - Fork 495
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
support progress bar formatters #755
base: master
Are you sure you want to change the base?
support progress bar formatters #755
Conversation
@@ -0,0 +1,24 @@ | |||
require 'parallel_tests' | |||
|
|||
module ParallelTests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some comments here would be nice (what it does / how it works etc)
@@ -212,6 +212,7 @@ def parse_options!(argv) | |||
opts.on("--serialize-stdout", "Serialize stdout output, nothing will be written until everything is done") { options[:serialize_stdout] = true } | |||
opts.on("--prefix-output-with-test-env-number", "Prefixes test env number to the output when not using --serialize-stdout") { options[:prefix_output_with_test_env_number] = true } | |||
opts.on("--combine-stderr", "Combine stderr into stdout, useful in conjunction with --serialize-stdout") { options[:combine_stderr] = true } | |||
opts.on("--progress-bar-compatible", "Serialize stdout output, but write immediately and rewrite on the fly") { options[:progress_bar_compatible] = true; options[:combine_stderr] = false } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about store and instance of the rewriter in the options so we don't have to use global vars ?
unless options[:serialize_stdout] | ||
|
||
if options[:progress_bar_compatible] | ||
ParallelTests::OutputRewriter.rewrite(new_group_output: result, group_index: env['TEST_ENV_NUMBER'].to_i) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
best pass in the env number via options or a new argument
that's some funky hackery :D |
@grosser Thank you for your feedback
Ok. I can use that approach. Maybe we can then reuse that JUnit parsing to produce a metadata file that will be used to split future test runs into more even groups (execution time wise). |
This looks awesome! -- How would I test this? -- I added this to my Gemfile:
and I added --progress-bar-compatible to .rspec_parallel Now it's saying:
Any ideas? |
@rgaufman you probably figured this out already, but the option goes in the terminal, not in the
|
@grosser this works beautifully, and I really like it. Would you be open to this solution if fix the issues described in the TODO section? @ivan-denysov I imagine you are no longer working on it? It's actually quite nice to have the progress bars separated out, I gives you a good idea about how balanced the tests are. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for this to be mergeable I'd like:
- testing
- docs
- bit of cleanup (see suggestions)
- ideally also a better name because it sounds super cryptic ... not sure if there is something better
What does this PR add?
new command line option
--progress-bar-compatible
that makes parallel_tests work nice with fuubar formatter for rspecWhy do we need it?
I tried to use fuubar with parallel_tests, but it doesn't look good: all progress bars are displayed concurrently on the same line. This PR adds an option that makes parallel_tests display every progress bar separately.
I thought that it might be possible to implement a generic solution that will work with any progress bar-like formatters in all supported test framework, but now I doubt it. I think that it will be complicated to achieve unless there will be a clear way to distinguish between the progress bar itself and other output that should be stored and displayed after all threads of parallel_tests finish execution. I want this option to act like
--serialize-stdout
, but it should display progress bars immediately and refresh them constantlyTODO
Fix blinking of progress bars. I'm probably not using the best way to rewrite content of the terminal.
Fix malformed output if there are pending or failing examples
Don't use ruby's global variables for output storage and mutex
Add tests
Any advice or guidance will be much appreciated