php-actions / phpunit

Run PHPUnit tests in Github Actions.
108 stars 24 forks source link

Fix default value of memory_limit in README.md #30

Closed osma closed 3 years ago

osma commented 3 years ago

I'm using php-actions/phpunit without setting a memory_limit. When I enabled the pcov extension to collect code coverage information (which uses more memory than before), my tests started failing with errors like this:

Time: 3.22 minutes, Memory: 20.00 MB

There were 3 errors:

1) ConceptSearchParametersTest::testGetVocabids
PHPUnit\Framework\Exception: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 65536 bytes) in /app/vendor/easyrdf/easyrdf/lib/Parser/Turtle.php on line 1186

2) ConceptSearchParametersTest::testGetSearchTerm
PHPUnit\Framework\Exception: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 65536 bytes) in /app/vendor/easyrdf/easyrdf/lib/RdfNamespace.php on line 423

3) ConceptSearchParametersTest::testGetSearchLang
PHPUnit\Framework\Exception: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 65536 bytes) in /app/vendor/easyrdf/easyrdf/lib/Graph.php on line 556

The current README.md states that the default memory_limit is 512M but this doesn't seem to be the case, as the actual memory limit is 128M according to the above error messages. There is no default value for the memory_limit setting in action.yml so I guess that the default value comes from PHP itself. Setting memory_limit to 512M fixed the problem with my tests.

This PR changes the README to state the correct default value for memory_limit. An alternative would be to set a default value of 512M in action.yml, so that reality would then correspond to the documentation.

g105b commented 3 years ago

Hi @osma,

Thank you for this PR. For some reason I had assumed that PHPUnit runs with a default of 512M, but I can't find where I got this information from (and it's obviously not the case).

I think updating the README here makes the most sense.

Thanks again, Greg.