Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

--group option does not filter out test classes with no @group annotation #432

Closed
ste93cry opened this issue Feb 26, 2020 · 1 comment · Fixed by #497
Closed

--group option does not filter out test classes with no @group annotation #432

ste93cry opened this issue Feb 26, 2020 · 1 comment · Fixed by #497
Labels

Comments

@ste93cry
Copy link

PHPUnit has a --group option that allows to specify which group of tests should be run. While Paratest has the same option, it behaves differently: it does not filter out test classes that do not have the @group annotation. Taking as example the code below (one class per file), I would expect that only the second test class is executed using the command vendor/bin/paratest --group=group1 while instead both are:

class FooTest extends \PHPUnit\Framework\TestCaseTestCase
{
}

/**
 * @group group1
 */
class BarTest extends \PHPUnit\Framework\TestCaseTestCase
{
}

Instead running plain PHPUnit using the command vendor/bin/phpunit --group=group1 works as expected. I tracked the error down to the SuiteLoader::testMatchGroupOptions method which returns true as long as no groups are defined on the test class. Even though I strongly believe that this is a bugfix, it also causes a huge BC. I'm willing to open PR to address the problem anyway, so let me know how we want to proceed

@Slamdunk Slamdunk added the bug label Jul 28, 2020
@Slamdunk
Copy link
Member

Hi, a PR with the bugfix would be really appreciated. We'll take care of merging it according to an appropriate semver tag.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants