| 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.
Summary
Hi 👋
When deprecations are encountered the
SouceMapperrecursively 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: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.