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.
Updated by Christian Kuhn about 3 years ago
- Related to Task #95999: Debugging with runTests.sh does not run in WSL2 added
Updated by Christian Kuhn about 3 years ago
- Related to Task #96013: CI: Use docker 20.10 instead of 19.03 added
Updated by Christian Kuhn about 3 years ago
We'll fix (1) now with the patch. With (2), my linux now needs some config too, which is not needed without that env-var ... I'll skip that for now, if really needed, we should tackle details with a dedicated (related) issue and patch.
Updated by Alexander Nitsche about 3 years ago
Ad (2): What about supporting to pass this environment variable manually and document that for Windows users?
Updated by Gerrit Code Review about 3 years ago
- Status changed from New to Under Review
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72194
Updated by Simon Gilli about 3 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset a0b146539a337208cae67571048b45f27e2300d1.
Updated by Gerrit Code Review about 3 years ago
- Status changed from Resolved to Under Review
Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72218
Updated by Simon Gilli about 3 years ago
- Status changed from Under Review to Resolved
Applied in changeset 61e45a68b64137b0ed907349cf7da7bc876449c0.
Updated by Alexander Nitsche almost 3 years ago
Does runTests.sh support Xdebug and path mapping with Windows+WSL2 with this patch?