diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f8ba1c7..fdd4edb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/tests/Functional/Command/ParallelCommandTest.php b/tests/Functional/Command/ParallelCommandTest.php index c34baf0e..23440da0 100644 --- a/tests/Functional/Command/ParallelCommandTest.php +++ b/tests/Functional/Command/ParallelCommandTest.php @@ -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(); diff --git a/tests/Functional/Runner/ChunkFileTest.php b/tests/Functional/Runner/ChunkFileTest.php index 2154f818..946810d3 100644 --- a/tests/Functional/Runner/ChunkFileTest.php +++ b/tests/Functional/Runner/ChunkFileTest.php @@ -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;