Task #94932
closedrunTests.sh: Allow step debugging tests on WSL2
100%
Description
The current runTests.sh Xdebug configuration works fine with Linux machines, but not for Windows WSL2 machines.
(1)
If the IDE (e.g. PhpStorm) is installed on the Windows host and the TYPO3 project is running in WSL2, the Xdebug host must not be calculated by
DOCKER_HOST=`route -n | awk '/^0.0.0.0/ { print $$2 }'`
but set by
DOCKER_HOST=host.docker.internal
where "host.docker.internal" is a magic host which is created automatically by Docker for Mac and Docker for Windows and points to the docker host, where the IDE resides. Therefore check if host.docker.internal is set, and only if not, calculate it as it is done currently.
(2)
Besides the adaption of the Xdebug host, on WSL2 the TYPO3 webserver paths do not match the Windows paths and thus have to be mapped - in contrary to Linux and MacOS. Mapping is done in the IDE for a specific hostname, and this hostname you have to specify in the environment variable "PHP_IDE_CONFIG" which is passed by Xdebug to PhpStorm, so it can use the correct path mapping. Setting this value to
PHP_IDE_CONFIG=\"serverName=typo3-run-tests\"
would mean you have to chose the hostname "typo3-run-tests" in your IDE's path mapping configuration. Add a default PHP_IDE_CONFIG to the runTests.sh setup which should do no harm on Linux and MacOS machines.
(3)
Last but not least document the WSL2 configuration at an appropriate page in docs.typo3.org.
Provide for TYPO3 v9, v10, v11.