Skip to content

Commit

Permalink
Merge pull request #278 from facile-it/port-274-to-2.x
Browse files Browse the repository at this point in the history
Port #274 to 2.x
  • Loading branch information
Jean85 authored Oct 3, 2024
2 parents f6c35c6 + 3017df2 commit 0ce128f
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Removed
* Drop support for PHPUnit < 10

## [1.3.1] - 2024-10-03
* Avoid passing `--testsuite` option to PHPUnit when running with chunks [#276](https://github.com/facile-it/paraunit/pull/276)

## [1.3.0] - 2022-06-15
### Added
* Add `--chunk-size` option [#164](https://github.com/facile-it/paraunit/pull/164)
Expand Down
21 changes: 21 additions & 0 deletions tests/Functional/Command/ParallelCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,27 @@ public function testRegressionExecutionWithStringFilter(): void
$this->assertStringContainsString(' 0 tests', $output, 'Filter is not working');
}

public function testExecutionWithChunksAndTestsuiteOption(): void
{
$application = new Application();
$application->add(new ParallelCommand(new ParallelConfiguration()));

$command = $application->find('run');
$commandTester = new CommandTester($command);
$commandTester->execute([
'command' => $command->getName(),
'--configuration' => $this->getConfigForStubs(),
'--testsuite' => 'stubs',
'--chunk-size' => 2,
'--debug' => true,
]);

$output = $commandTester->getDisplay();
$this->assertStringNotContainsString('--testsuite', $output);
$this->assertStringNotContainsString('No tests executed', $output);
$this->assertStringContainsString('--configuration', $output);
}

public function testExecutionWithDebugEnabled(): void
{
$configurationPath = $this->getConfigForStubs();
Expand Down
14 changes: 14 additions & 0 deletions tests/Functional/Runner/ChunkFileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,20 @@ class ChunkFileTest extends BaseIntegrationTestCase
// TODO: test chunk output with normal outcomes -- test name is now available!
// TODO: test chunk output with abnormal termination

public function testChunkedPlusTestSuiteOptions(): void
{
$this->setOption('chunk-size', '2');
$this->setOption('testsuite', 'stubs');
$this->setOption('debug', '1');
$this->loadContainer();

$this->executeRunner();

$output = $this->getConsoleOutput();
$this->assertStringNotContainsString('--testsuite', $output->getOutput());
$this->assertStringContainsString('--configuration', $output->getOutput());
}

public function testChunkedAllStubsSuite(): void
{
$chunkCount = 8;
Expand Down

0 comments on commit 0ce128f

Please sign in to comment.