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 #1

Updated by Christian Kuhn about 3 years ago

  • Related to Task #95999: Debugging with runTests.sh does not run in WSL2 added
Actions #2

Updated by Christian Kuhn about 3 years ago

  • Related to Task #96013: CI: Use docker 20.10 instead of 19.03 added
Actions #3

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.

Actions #4

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?

Actions #5

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

Actions #6

Updated by Simon Gilli about 3 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #7

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

Actions #8

Updated by Simon Gilli about 3 years ago

  • Status changed from Under Review to Resolved
Actions #9

Updated by Alexander Nitsche almost 3 years ago

Does runTests.sh support Xdebug and path mapping with Windows+WSL2 with this patch?

Actions #10

Updated by Benni Mack about 2 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF