Skip to content

Commit

Permalink
Fix progress output with copious data provider (#856)
Browse files Browse the repository at this point in the history
  • Loading branch information
Slamdunk committed May 31, 2024
1 parent e7385d4 commit d4de825
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/WrapperRunner/ApplicationForWrapperWorker.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ private function bootstrap(): void
$printer,
EventFacade::instance(),
false,
120,
99999,
$this->configuration->source(),
);

Expand Down
17 changes: 17 additions & 0 deletions test/Unit/WrapperRunner/WrapperRunnerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,23 @@ public function testFunctionalParallelizationWithJunitLogging(): void
self::assertSame(RunnerInterface::SUCCESS_EXIT, $runnerResult->exitCode);
}

#[Group('github')]
#[CoversNothing]
public function testLongDataProviderShouldNotFillUnexpectedOutputFile(): void
{
$this->bareOptions['--configuration'] = $this->fixture('github' . DIRECTORY_SEPARATOR . 'GH853' . DIRECTORY_SEPARATOR . 'phpunit.xml');
$runnerResult = $this->runRunner();

self::assertStringNotContainsString('101 / 1000 ( 10%) 202 / 1000 ( 20%)', $runnerResult->output);
self::assertEquals(RunnerInterface::SUCCESS_EXIT, $runnerResult->exitCode);
}

/**
* ### WARNING ###
*
* This test MUST be the last of this file,
* otherwise the next one will always fail
*/
public function testProcessIsolation(): void
{
$this->bareOptions['path'] = $this->fixture('process_isolation' . DIRECTORY_SEPARATOR . 'FooTest.php');
Expand Down
26 changes: 26 additions & 0 deletions test/fixtures/github/GH853/ThousandTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

namespace ParaTest\Tests\fixtures\github\GH853;

use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

use function array_fill;

/** @internal */
final class ThousandTest extends TestCase
{
/** @return list<positive-int> */
public static function rangeOfNumbersProvider(): array
{
return array_fill(1, 1000, [1]);
}

#[DataProvider('rangeOfNumbersProvider')]
public function testRangeOfNumbers(int $integer): void
{
$this->assertIsInt($integer);
}
}
7 changes: 7 additions & 0 deletions test/fixtures/github/GH853/phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<phpunit>
<testsuites>
<testsuite name="Github issue">
<file>ThousandTest.php</file>
</testsuite>
</testsuites>
</phpunit>

0 comments on commit d4de825

Please sign in to comment.