Project

General

Profile

Actions

Task #94932

closed

runTests.sh: Allow step debugging tests on WSL2

Added by Alexander Nitsche over 3 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Tests
Target version:
Start date:
2021-08-19
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
Sprint Focus:

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.


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Task #95999: Debugging with runTests.sh does not run in WSL2ClosedSimon Gilli2021-11-16

Actions
Related to TYPO3 Core - Task #96013: CI: Use docker 20.10 instead of 19.03Closed2021-11-17

Actions
Actions

Also available in: Atom PDF