Open getsource opened 4 years ago
As some added information here, it looks like the code to retrieve environment exists in both: https://github.com/WordPress/phpunit-test-runner/blob/master/prepare.php#L91 and https://github.com/WordPress/phpunit-test-runner/blob/master/functions.php#L183
It'd probably be a good idea to see if we can consolidate these two as a part of this issue.
I'm not sure if this is the most elegant or not, but thinking about splitting it out into a file that can be either piped into SSH + run, and/or included (when the information is best gathered locally) would do the trick.
I'm not sure if there was a reason for bundling it into wp-tests-config.php
rather than running the env gathering PHP directly on the destination machine, but insight or recommendations are welcome.
Environment information collection happens via a string replacement on https://github.com/WordPress/phpunit-test-runner/blob/master/prepare.php#L91.
This means that if the comments in
wp-tests-config-sample.php
are changed in core, environment reporting in the test runner breaks. This ticket is a follow-up to when this happened in #105.We should make this reporting less brittle so that it doesn't break when minor changes are made in core.
See #105 #109.