diff --git a/src/WrapperRunner/ApplicationForWrapperWorker.php b/src/WrapperRunner/ApplicationForWrapperWorker.php index 6647b28f..aded1cfb 100644 --- a/src/WrapperRunner/ApplicationForWrapperWorker.php +++ b/src/WrapperRunner/ApplicationForWrapperWorker.php @@ -84,14 +84,14 @@ public function runTest(string $testPath): int $testSuite = TestSuite::fromClassReflector($testSuiteRefl); } - (new TestSuiteFilterProcessor())->process($this->configuration, $testSuite); - if (CodeCoverage::instance()->isActive()) { CodeCoverage::instance()->ignoreLines( (new CodeCoverageMetadataApi())->linesToBeIgnored($testSuite), ); } + (new TestSuiteFilterProcessor())->process($this->configuration, $testSuite); + if ($filter !== null) { $testSuite->injectFilter($filter); diff --git a/test/Unit/WrapperRunner/WrapperRunnerTest.php b/test/Unit/WrapperRunner/WrapperRunnerTest.php index d1b1a966..402ae7f2 100644 --- a/test/Unit/WrapperRunner/WrapperRunnerTest.php +++ b/test/Unit/WrapperRunner/WrapperRunnerTest.php @@ -580,6 +580,17 @@ public function testHandleUnexpectedOutput(): void self::assertStringMatchesFormat($expectedOutput, $runnerResult->output); } + /** @group github */ + #[CoversNothing] + public function testGroupOptionWithDataProviderAndCodeCoverageEnabled(): void + { + $this->bareOptions['--configuration'] = $this->fixture('github' . DIRECTORY_SEPARATOR . 'GH782' . DIRECTORY_SEPARATOR . 'phpunit.xml'); + $this->bareOptions['--group'] = 'default'; + + $runnerResult = $this->runRunner(); + self::assertSame(RunnerInterface::SUCCESS_EXIT, $runnerResult->exitCode); + } + /** * \PHPUnit\Runner\Filter\NameFilterIterator uses `preg_match`, and in * \ParaTest\Tests\fixtures\function_parallelization_tests\FunctionalParallelizationTest::dataProvider2 diff --git a/test/fixtures/github/GH431/IssueTest.php b/test/fixtures/github/GH431/IssueTest.php index 9bbad8b1..19d3b559 100644 --- a/test/fixtures/github/GH431/IssueTest.php +++ b/test/fixtures/github/GH431/IssueTest.php @@ -14,7 +14,7 @@ final class IssueTest extends TestCase public function testFillBuffers(): void { // the string is larger than the output buffer. - // if the parent process doesnt read the output buffer, this test will hang forever. + // if the parent process doesn't read the output buffer, this test will hang forever. echo str_repeat('a', 10000); $this->assertTrue(true); diff --git a/test/fixtures/github/GH782/IssueTest.php b/test/fixtures/github/GH782/IssueTest.php new file mode 100644 index 00000000..837d6d10 --- /dev/null +++ b/test/fixtures/github/GH782/IssueTest.php @@ -0,0 +1,26 @@ +value); + } + + /** @return list> */ + public static function provideThings(): array + { + return [ + [true], + ]; + } +} diff --git a/test/fixtures/github/GH782/Something.php b/test/fixtures/github/GH782/Something.php new file mode 100644 index 00000000..a584afdc --- /dev/null +++ b/test/fixtures/github/GH782/Something.php @@ -0,0 +1,16 @@ +value = $value; + } +} diff --git a/test/fixtures/github/GH782/phpunit.xml b/test/fixtures/github/GH782/phpunit.xml new file mode 100644 index 00000000..cdeba139 --- /dev/null +++ b/test/fixtures/github/GH782/phpunit.xml @@ -0,0 +1,17 @@ + + + + IssueTest.php + + + + + + + + + + Something.php + + + diff --git a/test/fixtures/github/GH782/tmp/.gitignore b/test/fixtures/github/GH782/tmp/.gitignore new file mode 100644 index 00000000..c96a04f0 --- /dev/null +++ b/test/fixtures/github/GH782/tmp/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file