-
Notifications
You must be signed in to change notification settings - Fork 269
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
Pass WordPress unit tests #111
Comments
Here's the output of
|
There are numerous test failures and many (or all) of them are related to running WordPress on SQLite:
cc @aristath |
I just ran the full WordPress test suite on latest CLI integration (on PHP 8.0 and using an actual MySQL database). I had to remove Conclusions
14,313 tests passedThat's much more than I expected. This is a huge win! Wow! 21 tests errored outParticularly interesting: Most errors are caused by unavailable PHP extensions. These ones are unclear to me:
101 tests failed101 may seem like a lot, but fortunately the failures reasons were trivial:
175 tests were skipped.The following problems were reported:
Specific test suites that failed:
|
### Description Adds support for CLI SAPI and networking in node.js: ``` > npm run build > node ./build-cli/php-cli.js -r 'echo "Hello from PHP !";' Hello from PHP ! > node ./build-cli/php-cli.js -r 'echo substr(file_get_contents("https://wordpress.org"), 0, 16);' <!DOCTYPE html> > node ./build-cli/php-cli.js -r 'echo phpversion();' 8.2.0-dev > PHP=5.6 node ./build-cli/php-cli.js -r 'echo phpversion();' 5.6.40 ``` ### Highlights: * Networking is supported (including MySQL and HTTPS) * Switching PHP versions is supported. * [Most WordPress PHPUnit tests pass](#111). The failures are caused by missing extensions and a few misconfigured settings * PHP Interactive mode is supported but [the arrow keys don't work](#118) * `wp-cli` works ### In broad strokes: * CLI SAPI is compiled with libedit (readline replacement) and ncurses. * Network calls are asynchronous. Emscripten's Asyncify enables calling asynchronous code from synchronous code. TCP sockets are shimmed with a WebSocket connection to a built-in proxy server running on localhost. It supports data transfer, arbitrary connection targets, and setting a few TCP socket options. * PHP's OpenSSL uses the same CA certs as Node.js * PHP 5.6 is patched to work with OpenSSL 1.1.0 and many other small patches are introduced. For more details, see [patches overview](#119 (comment)), Dockerfile, and `phpwasm-emscripten-library.js` ### Future work: * PHP Interactive server isn't supported yet. Adding support is a matter of making the incoming connection polling non-blocking using Asyncify. * Use a more recent OpenSSL version * [Better support for CLI interactive mode](#118)
I was just thinking about this in the context of https://make.wordpress.org/hosting/handbook/tests/. It would be cool to see WP playground test results on https://make.wordpress.org/hosting/test-results/ eventually. |
One of the problems with SQLite support is that PDO SQLite doesn't seem to support parameters in the
PDO MySQL, however, does support that:
|
Turns out there's many ways to write a MySQL query that the plugin won't correctly rewrite to SQLite. One solution would be to stop rewriting SQL queries using regular expressions and consume them accordingly to the correct grammar. The fix would need to be implemented in the upstream plugin. |
The new and improved SQLite support passes nearly all PHPUnit tests – let's bring it over as soon as it's merged into the |
Update: here's the status with the new SQLite plugin:
Specific failures involve tests like
And multiple I'd say this is pretty close! |
### Description Adds support for CLI SAPI and networking in node.js: ``` > npm run build > node ./build-cli/php-cli.js -r 'echo "Hello from PHP !";' Hello from PHP ! > node ./build-cli/php-cli.js -r 'echo substr(file_get_contents("https://wordpress.org"), 0, 16);' <!DOCTYPE html> > node ./build-cli/php-cli.js -r 'echo phpversion();' 8.2.0-dev > PHP=5.6 node ./build-cli/php-cli.js -r 'echo phpversion();' 5.6.40 ``` ### Highlights: * Networking is supported (including MySQL and HTTPS) * Switching PHP versions is supported. * [Most WordPress PHPUnit tests pass](WordPress/wordpress-playground#111). The failures are caused by missing extensions and a few misconfigured settings * PHP Interactive mode is supported but [the arrow keys don't work](WordPress/wordpress-playground#118) * `wp-cli` works ### In broad strokes: * CLI SAPI is compiled with libedit (readline replacement) and ncurses. * Network calls are asynchronous. Emscripten's Asyncify enables calling asynchronous code from synchronous code. TCP sockets are shimmed with a WebSocket connection to a built-in proxy server running on localhost. It supports data transfer, arbitrary connection targets, and setting a few TCP socket options. * PHP's OpenSSL uses the same CA certs as Node.js * PHP 5.6 is patched to work with OpenSSL 1.1.0 and many other small patches are introduced. For more details, see [patches overview](WordPress/wordpress-playground#119 (comment)), Dockerfile, and `phpwasm-emscripten-library.js` ### Future work: * PHP Interactive server isn't supported yet. Adding support is a matter of making the incoming connection polling non-blocking using Asyncify. * Use a more recent OpenSSL version * [Better support for CLI interactive mode](WordPress/wordpress-playground#118)
@JanJakes this might be interesting for you in exploring the MySQL parser |
Description
It would be amazing to run
PHPUnit
tests using WordPress Playground:Current status
See the comments for specific failures
cc @hellofromtonya
The text was updated successfully, but these errors were encountered: