-
Notifications
You must be signed in to change notification settings - Fork 534
Init container before DataProvider is called #4342
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
Conversation
phpunit.xml
Outdated
<extensions> | ||
<bootstrap class="PHPStan\Testing\PHPUnit\PHPUnitExtension"/> | ||
</extensions> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in case extension developer have to deal with the same race condition problems, we could instruct them to use the extension, which takes care of bootstrapping/re-building the container for them
I think we should instruct PHPStan to not scan the files in have no idea yet how todo the php version specific config |
This pull request has been marked as ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it excluded from analysis? It ships with the PHAR, it should pass the analysis.
use PHPUnit\Runner\Extension\ParameterCollection; | ||
use PHPUnit\TextUI\Configuration\Configuration; | ||
|
||
final class PHPUnitExtension implements Extension |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name should be PHPStanPHPUnitExtension
PHP version specific config is already happening, check the files in build/. There's ignore-by-php-version... |
see https://github.com/phpstan/phpstan-src/actions/runs/17822286344/job/50667691251?pr=4342 there are non-ignorable errors.. it seems PHPStan is smart enough to realize that PHPUnit 9.x does not contain the interface the extension is using |
You can put excludePaths into a new neon file and add it to includes if the PHPUnit version is older than 10. |
used the already existing old-phpunit.neon for that. |
Super nice, thank you! |
without this fix we saw errors like