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

Do not pass --testsuite when running with chunks #276

Merged
merged 9 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN apk --no-cache add \
nano \
libzip-dev \
&& docker-php-ext-install -j5 zip pcntl \
&& pecl install xdebug \
&& pecl install xdebug-2.9.0 \
&& docker-php-ext-enable xdebug

#COMPOSER
Expand Down
20 changes: 20 additions & 0 deletions tests/Functional/Command/ParallelCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,26 @@ public function testExecutionWithLogo(): void
$this->assertStringContainsString('BBBBbBBBBBBB', $output, 'Shark logo missing');
}

public function testExecutionWithChunks(): 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->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 @@ -12,6 +12,20 @@

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

$this->executeRunner();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is in \Paraunit\Command\ParallelCommand::addPHPUnitOptions which it should not be covered by this test case.


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

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