In my D8 project I have Unit and Kernel tests. Running them (via CLI) without "--coverage-html" is fine. Unit tests in general are ~300ms, Kernels are around 3s (of course based on the size of dependencies and the amount of the test cases).
But when I also want to have code coverage Unit tests are fast as usual but Kernel tests are incredible slow (10-20 minutes).
I started to use filters and whitelisting in the phpunit config file, but that affects only the result (the generated coverage files) but not the speed, which makes the impression that PHPUnit also loops through the Kernel Dependencies (such as core files).
Has anyone met this problem before? What can cause it?
Here is my filtering options:
<filter> <whitelist> <directory suffix=".php">./web/modules/custom/test_module</directory> </whitelist> </filter>