Closed remcotolsma closed 5 years ago
Hey thanks for bringing this up; nice to see someone else using it too!
This has been quite strange to debug, but from the looks of things it seems like wp-phpunit's wp-tests-config.php
is not loaded during the loading of wp-phpunit/includes/install.php
.
I thought this might be from HHVM handling require
differently somehow for performance, but even when changing this to a simple include
it doesn't change the result.
The require_once
call in install.php
which loads the config file returns a 1
but doesn't load it. https://github.com/wp-phpunit/wp-phpunit/blob/873de1a437bed42a44a353d1fc1769189eced065/includes/install.php#L13
It definitely is not due to being unable to locate the user's test config file though; that would result in a different error anyways.
The only thing I can think of is that HHVM is not requiring the file since it has already been loaded in bootstrap.php
even though install.php
is called as a separate process. Maybe a bug with HHVM?
Have you been able to run the test suite on HHVM without wp-phpunit before? It seems like the WP core test suite would have the same problem, but they no longer include HHVM in their tests.
Thanks, i did some local debugging on my Mac and it looks like it is related to this line: https://github.com/wp-phpunit/wp-phpunit/blob/4.9.6/includes/bootstrap.php#L68
system( WP_PHP_BINARY . ' ' . escapeshellarg( dirname( __FILE__ ) . '/install.php' ) . ' ' . escapeshellarg( $config_file_path ) . ' ' . $multisite, $retval );
The WP_PHP_BINARY
is defined in wp-config.php
:
But changing this to hhvm
is not solving the issue.
If i do a var_dump( getenv( 'WP_PHPUNIT__TESTS_CONFIG' ) );
in wp-tests-config.php
it will result in false
if it runs install.php
via the system
function. So i think there are some issues with the environment variables.
But no problem, i also saw this article last weekend: https://kinsta.com/blog/hhvm-wordpress/. For now we will add HHVM to the allow_failures
section in the Travis CI config file.
brew tap hhvm/hhvm
brew install hhvm
hhvm vendor/bin/phpunit
OFFTOPIC: @aaemnnosttv just wanted to drop you a note that I do also use this! Keep up the good work.
HHVM hasn't been supported by WordPress for a couple of years now: https://make.wordpress.org/core/2017/05/25/hhvm-no-longer-part-of-wordpress-cores-testing-infrastructure/
Closing as a wontfix. Sorry HHVM!
I'm getting errors on Travis CI with HHVM, see for example:
It seems like HHVM can't require the
WP_PHPUNIT__TESTS_CONFIG
file in https://github.com/wp-phpunit/wp-phpunit/blob/4.9.6/wp-tests-config.php#L11-L13.First i thought it was a issue with the relative path in the
phpunit.xml
config file:But an absolute path in the PHPUnit bootstrap file was also not working:
Maybe you can extend the example projects with HHVM support?