-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Distinguish between first and subsequent progress bar displays #19134
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
Conversation
With the changes made by symfony#19134, the `\Symfony\Component\Console\Tests\Helper\ProgressBarTest::testMultipleStart()` test fails. This patch fixes the test for symfony#19134.
@@ -521,21 +521,27 @@ private function setMaxSteps($max) | |||
*/ | |||
private function overwrite($message) | |||
{ | |||
static $firstTime = true; |
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.
should be better as a property, isn't it?
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.
Having a private property is fine.
The pain is that this is going to be a test every time the progress bar is updated.
Somewhere there has to be a switch between 1st and not 1st, so I suspect there is no way to not have the test.
Tests need to pass of course, and new tests added to cover the behavior. |
@rquadling you should get rid of only one of them, and update the other PR to contain all changes |
I've closed #19135. You can do the change directly in this PR now. No need to create yet another one. |
a535c71
to
1ca75ad
Compare
@@ -17,6 +17,7 @@ | |||
|
|||
/** | |||
* @group time-sensitive | |||
* @group pb |
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.
why have you added a new group here?
Thank you @rquadling. |
…lays (rquadling) This PR was merged into the 2.7 branch. Discussion ---------- Distinguish between first and subsequent progress bar displays | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #19133 | License | MIT | Doc PR | reference to the documentation PR, if any Fixes #19133 When a progress bar is first displayed, if it is multi-line, previously output lines are erased, depending upon the number of lines in the progress bar. This patch fixes that be distinguishing between the first display (no erasing of previous output) and subsequent displays of the progress bar. Commits ------- 3871e1a Differentiate between the first time a progress bar is displayed and subsequent times
Thank you. |
|
||
private function isFirstRun() | ||
{ | ||
return $this->firstRun; |
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.
imo this method as well as the one below should have been inlined
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.
Of course! #19163
Fixes #19133
When a progress bar is first displayed, if it is multi-line, previously output lines are erased, depending upon the number of lines in the progress bar.
This patch fixes that be distinguishing between the first display (no erasing of previous output) and subsequent displays of the progress bar.