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

Implement group attribute on <directory> and <file> elements (children of <testsuite>) to add all tests found in a directory or file to a specified group #5620

Closed
mlahargou opened this issue Dec 18, 2023 · 0 comments
Labels
feature/configuration/xml feature/test-runner CLI test runner type/enhancement A new idea that should be implemented

Comments

@mlahargou
Copy link

Problem:

We like to keep our unit tests fast (<1s). If they are slow, we want them to fail. Adding @small to every (100s) test class is a bit verbose and prone to forgetting to add it for new unit test classes.

Solution < v10:

We had a UnitTestCase that extended TestCase. That class overrode the getSize method to return return PHPUnit\Util\Test::SMALL. (I know getSize was marked as internal, but it was a workaround for the time being). All of our unit tests extended UnitTestCase.

Proposal :

It would be nice if there was a way to mark a directory as a certain size or if the @small annotation could be added to parent classes. In our case, we could add the @small annotation to UnitTestCase and then all of the children of that class would inherit that annotation.

@mlahargou mlahargou added the type/enhancement A new idea that should be implemented label Dec 18, 2023
@sebastianbergmann sebastianbergmann changed the title Test size: Ability to set size for group of tests Implement group attribute on <directory> element (child of <testsuite>) to add all tests found in a directory to a specified group Dec 19, 2023
@sebastianbergmann sebastianbergmann changed the title Implement group attribute on <directory> element (child of <testsuite>) to add all tests found in a directory to a specified group Implement group attribute on <directory> and <file> elements (children of <testsuite>) to add all tests found in a directory or file to a specified group Dec 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/configuration/xml 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