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

Support --exclude-filter to exclude tests matching the exclude-filter expression #5467

Closed
krchiper opened this issue Aug 11, 2023 · 1 comment
Labels
feature/test-runner CLI test runner type/enhancement A new idea that should be implemented

Comments

@krchiper
Copy link

krchiper commented Aug 11, 2023

Make support to exclude certain tests by name, just like how --exclude-groups can exclude tests by group. The option could be called --exclude-filter and should run all tests except those matching the --exclude-filter, the expression should work like the inverse of --filter, just like --exclude-group is the inverse of --group

Use case
If you want to divide all your tests into seperate runners it is convient to analyze the output from last test run (e.g. junit.xml) and create a filter so you can get X seperate runners. If you use explicit filters for all runners, you won't discover new tests added.

Example:
Runner1 - Slice A: phpunit --filter /^testa|testb|testc$/
Runner2 - Slice B: phpunit --filter /^testd|teste|testf$/
Runner3 - Slice Rest: phpunit --exclude-filter /^testa|testb|testc|testd|teste|testf$/

Runner3 is supposed to run everything which is not part of Runner1 and 2.

@sebastianbergmann
Copy link
Owner

#5629 has been merged for PHPUnit 11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/test-runner CLI test runner type/enhancement A new idea that should be implemented
Projects
None yet
Development

No branches or pull requests

2 participants