-
Notifications
You must be signed in to change notification settings - Fork 383
Closed
Labels
BugSomething isn't workingSomething isn't workingChangeloggedWhether the issue/PR has been added to release notes.Whether the issue/PR has been added to release notes.
Milestone
Description
Bug Description
With the update to wp-env 5.0.0, running npm run test:php now results in a fatal error. This package update had a backwards-incompatible change as explained in the release notes:
Breaking Changes
- Removed the
WP_PHPUNIT__TESTS_CONFIGenvironment variable from thephpunitcontainer. This removes automatic support for thewp-phpunit/wp-phpunitComposer package. To continue using the package, set the following two environment variables in yourphpunit.xmlfile or similar:WP_TESTS_DIR=""andWP_PHPUNIT__TESTS_CONFIG="/wordpress-phpunit/wp-tests-config.php".- Removed the generated
/var/www/html/phpunit-wp-config.phpfile from the environment.
We didn't catch it via CI because GHA doesn't run Docker to run the tests. When running in the local Docker-based dev environment, however, it is broken.
Expected Behaviour
Running PHPUnit tests, both npm run test:php and npm run test:php:xdebug, should work successfully.
Screenshots
$ npm run test:php
> amp-wp@ test:php /home/westonruter/repos/amp
> wp-env run phpunit 'WORDPRESS_TABLE_PREFIX=wptests_ WP_TESTS_DIR=/var/www/wordpress-develop/tests/phpunit /var/www/html/wp-content/plugins/amp/vendor/bin/phpunit -c /var/www/html/wp-content/plugins/amp/phpunit.xml.dist $npm_config_args'
ℹ Starting 'WORDPRESS_TABLE_PREFIX=wptests_ WP_TESTS_DIR=/var/www/wordpress-develop/tests/phpunit /var/www/html/wp-content/plugins/amp/vendor/bin/phpunit -c /var/www/html/wp-content/plugins/amp/phpunit.xml.dist $npm_config_args' on the phpunit container.
Starting aabe871bb4b92d5867707c9f76aa7c03_tests-mysql_1 ... done
Starting aabe871bb4b92d5867707c9f76aa7c03_tests-wordpress_1 ... done
wp_die() called
Message: <p>There has been a critical error on this website.</p><p><a href="https://wordpress.org/support/article/faq-troubleshooting/">Learn more about troubleshooting WordPress.</a></p>
Title: WordPress › Error
Args:
response: 500
code: internal_server_error
exit:
back_link:
link_url:
link_text:
text_direction: ltr
charset: UTF-8
additional_errors: array (
)
PHP Version
No response
Plugin Version
2.3.0
AMP plugin template mode
Standard, Transitional, Reader
WordPress Version
No response
Site Health
No response
Gutenberg Version
No response
OS(s) Affected
No response
Browser(s) Affected
No response
Device(s) Affected
No response
Acceptance Criteria
No response
Implementation Brief
No response
QA Testing Instructions
No response
Demo
No response
Changelog Entry
No response
Metadata
Metadata
Assignees
Labels
BugSomething isn't workingSomething isn't workingChangeloggedWhether the issue/PR has been added to release notes.Whether the issue/PR has been added to release notes.