Skip to content
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

Port #274 to 2.x #278

Merged
merged 7 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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