-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
feature/test-runnerCLI test runnerCLI test runnertype/performanceIssues related to resource consumption (time and memory)Issues related to resource consumption (time and memory)version/11Something affects PHPUnit 11Something affects PHPUnit 11version/12Something affects PHPUnit 12Something affects PHPUnit 12
Description
| Q | A |
|---|---|
| PHPUnit version | 11.5.3 |
| PHP version | 8.3 |
| Installation Method | PHAR + Composer |
Summary
Hi 👋
When deprecations are encountered the SouceMapper recursively scans all files for each <source> include and exclude paths.
This causes a siginficant pause in PHPUnit as it scans all these files, initially for 16 seconds until we isolated the issue and refined the <source> list - now it's "only" 3 seconds.
Current behavior
Scans all files when a deprecation is encountered.
How to reproduce
Add a <source> configuration:
<source>
<include>
<directory suffix=".php">src/</directory>
<directory suffix=".php">perhaps-another-directory-here/</directory>
</include>
<exclude>
<directory suffix=".php">src/SubFolder</directory>
<!-- maybe serveral more here -->
</exclude>
</source>
- Run a test that would trigger a deprecation
- Observe that source mapper will recursively iterate over all the files in the above paths.
https://github.com/sebastianbergmann/phpunit/blob/main/src/Runner/ErrorHandler.php#L178
Expected behavior
That a triggered deprecation would not scan all the files and block the test run for N seconds.
TomA-RTomA-R
Metadata
Metadata
Assignees
Labels
feature/test-runnerCLI test runnerCLI test runnertype/performanceIssues related to resource consumption (time and memory)Issues related to resource consumption (time and memory)version/11Something affects PHPUnit 11Something affects PHPUnit 11version/12Something affects PHPUnit 12Something affects PHPUnit 12