auraphp/Aura.Uri

PHPUnit Code Coverage runs out of memory

pmjones opened this issue · 6 comments

I'm running the tests with --coverage-html to make sure everything's covered, and PHPUnit runs out of memory (even at 512M). As far as I can tell it's because it has to track the public-suffix-list.php file as part of the coverage.

To remedy this, can you determine what subset of the public suffix list is needed for the tests, and then embed that subset as an array in the test when constructing the PSL? I know that's a hassle, and if I have time I'll do it myself, but my guess is that you'd be more effective and efficient at it.

@pmjones I tried for Aura.Signal also. So I don't think it is due to the public suffix list. It seems the problem with @phpunit itself.

I just tried Aura.Signal with a memory limit of 128M and it ran fine with --coverage-html.

hm, not sure then, I tried with 512MB :( .

aah it seems working. I guess it was my problem with keeping MB, than just M 👍 . Now 512 seems working, 128M is hard.

/media/Linux/aurasystem/package/Aura.Uri/tests [develop] $ phpunit --coverage-html hello1
PHPUnit 3.6.10 by Sebastian Bergmann.

Configuration read from /media/Linux/aurasystem/package/Aura.Uri/tests/phpunit.xml

...............................................................  63 / 106 ( 59%)
...........................................

Time: 4 seconds, Memory: 38.25Mb

OK (106 tests, 198 assertions)

Generating code coverage report, this may take a moment.
/media/Linux/aurasystem/package/Aura.Uri/tests [develop] $ l
Aura/  bootstrap.php  hello1/  phpunit.xml
/media/Linux/aurasystem/package/Aura.Uri/tests [develop] $ php -i | grep memory_limit
memory_limit => 512M => 512M

Per commit 082abb1 I have embedded the data in the test, but PHPUnit still runs out of memory with --coverage-html when running the public suffix tests. Not sure what would be causing that.

Previously I had to raise php.ini memory_limit from defaul 128M to 512M and it still failed; now I can raise it to just 140M and that gives it enough memory. I'll call that sufficient.