Commit 88744a94 authored by Christian Kuhn's avatar Christian Kuhn Committed by Anja Leichsenring
Browse files

[TASK] runTests.sh: Allow step debugging acceptance tests

Honor -x option for acceptance tests: Both 'Tester' and
'System under test' allow break points with -s acceptance
and -s install.

Resolves: #93734
Releases: master
Change-Id: Ia3f5a518089be675e33ddc673ebd4c99b2dbfaf6
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/68380


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
parent db35bdf8
......@@ -182,7 +182,7 @@ Options:
- 7.4 (default): use PHP 7.4
- 8.0: use PHP 8.0
-e "<phpunit or codeception options>"
-e "<phpunit options>"
Only with -s functional|unit|unitDeprecated|unitRandom
Additional options to send to phpunit (unit & functional tests) or codeception (acceptance
tests). For phpunit, options starting with "--" must be added after options starting with "-".
......@@ -190,7 +190,7 @@ Options:
named "canRetrieveValueWithGP"
-x
Only with -s functional|unit|unitDeprecated|unitRandom
Only with -s functional|unit|unitDeprecated|unitRandom|acceptance|install
Send information to host instance for test or system under test break points. This is especially
useful if a local PhpStorm instance is listening on default xdebug port 9003. A different port
can be selected with -y
......
......@@ -40,7 +40,19 @@ services:
stop_grace_period: 1s
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
command: php -dxdebug.mode=off -S web:8000 -t ${CORE_ROOT}
command: >
/bin/sh -c "
if [ ${PHP_XDEBUG_ON} -eq 0 ]; then
XDEBUG_MODE=\"off\" \
php -S web:8000 -t ${CORE_ROOT}
else
DOCKER_HOST=`route -n | awk '/^0.0.0.0/ { print $$2 }'`
XDEBUG_MODE=\"debug,develop\" \
XDEBUG_TRIGGER=\"foo\" \
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=$${DOCKER_HOST}\" \
php -S web:8000 -t ${CORE_ROOT}
fi
"
redis4:
image: redis:4-alpine
......@@ -100,7 +112,16 @@ services:
COMMAND=\"bin/codecept run Backend -d -c typo3/sysext/core/Tests/codeception.yml ${TEST_FILE} --xml reports.xml --html reports.html\"
fi
mkdir -p typo3temp/var/tests/
php -dxdebug.mode=off $${COMMAND}
if [ ${PHP_XDEBUG_ON} -eq 0 ]; then
XDEBUG_MODE=\"off\" \
$${COMMAND};
else
DOCKER_HOST=`route -n | awk '/^0.0.0.0/ { print $$2 }'`
XDEBUG_MODE=\"debug,develop\" \
XDEBUG_TRIGGER=\"foo\" \
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=$${DOCKER_HOST}\" \
$${COMMAND};
fi
"
prepare_acceptance_backend_mysql:
......@@ -147,7 +168,16 @@ services:
COMMAND=\"bin/codecept run Backend -d -c typo3/sysext/core/Tests/codeception.yml ${TEST_FILE} --xml reports.xml --html reports.html\"
fi
mkdir -p typo3temp/var/tests/
php -dxdebug.mode=off $${COMMAND}
if [ ${PHP_XDEBUG_ON} -eq 0 ]; then
XDEBUG_MODE=\"off\" \
$${COMMAND};
else
DOCKER_HOST=`route -n | awk '/^0.0.0.0/ { print $$2 }'`
XDEBUG_MODE=\"debug,develop\" \
XDEBUG_TRIGGER=\"foo\" \
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=$${DOCKER_HOST}\" \
$${COMMAND};
fi
"
prepare_acceptance_backend_postgres:
......@@ -197,7 +227,16 @@ services:
COMMAND=\"bin/codecept run Backend -d -c typo3/sysext/core/Tests/codeception.yml ${TEST_FILE} --xml reports.xml --html reports.html\"
fi
mkdir -p typo3temp/var/tests/
php -dxdebug.mode=off $${COMMAND}
if [ ${PHP_XDEBUG_ON} -eq 0 ]; then
XDEBUG_MODE=\"off\" \
$${COMMAND};
else
DOCKER_HOST=`route -n | awk '/^0.0.0.0/ { print $$2 }'`
XDEBUG_MODE=\"debug,develop\" \
XDEBUG_TRIGGER=\"foo\" \
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=$${DOCKER_HOST}\" \
$${COMMAND};
fi
"
prepare_acceptance_install_mysql:
......@@ -236,8 +275,17 @@ services:
if [ ${SCRIPT_VERBOSE} -eq 1 ]; then
set -x
fi
mkdir -p typo3temp/var/tests/ \
&& php -dxdebug.mode=off bin/codecept run Install -d -c typo3/sysext/core/Tests/codeception.yml --env=mysql --xml reports.xml --html reports.html
mkdir -p typo3temp/var/tests/
if [ ${PHP_XDEBUG_ON} -eq 0 ]; then
XDEBUG_MODE=\"off\" \
bin/codecept run Install -d -c typo3/sysext/core/Tests/codeception.yml --env=mysql --xml reports.xml --html reports.html
else
DOCKER_HOST=`route -n | awk '/^0.0.0.0/ { print $$2 }'`
XDEBUG_MODE=\"debug,develop\" \
XDEBUG_TRIGGER=\"foo\" \
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=$${DOCKER_HOST}\" \
bin/codecept run Install -d -c typo3/sysext/core/Tests/codeception.yml --env=mysql --xml reports.xml --html reports.html
fi
"
prepare_acceptance_install_mariadb:
......@@ -276,8 +324,17 @@ services:
if [ ${SCRIPT_VERBOSE} -eq 1 ]; then
set -x
fi
mkdir -p typo3temp/var/tests/ \
&& php -dxdebug.mode=off bin/codecept run Install -d -c typo3/sysext/core/Tests/codeception.yml --env=mysql --xml reports.xml --html reports.html
mkdir -p typo3temp/var/tests/
if [ ${PHP_XDEBUG_ON} -eq 0 ]; then
XDEBUG_MODE=\"off\" \
bin/codecept run Install -d -c typo3/sysext/core/Tests/codeception.yml --env=mysql --xml reports.xml --html reports.html
else
DOCKER_HOST=`route -n | awk '/^0.0.0.0/ { print $$2 }'`
XDEBUG_MODE=\"debug,develop\" \
XDEBUG_TRIGGER=\"foo\" \
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=$${DOCKER_HOST}\" \
bin/codecept run Install -d -c typo3/sysext/core/Tests/codeception.yml --env=mysql --xml reports.xml --html reports.html
fi
"
prepare_acceptance_install_postgres:
......@@ -316,8 +373,17 @@ services:
if [ ${SCRIPT_VERBOSE} -eq 1 ]; then
set -x
fi
mkdir -p typo3temp/var/tests/ \
&& php -dxdebug.mode=off bin/codecept run Install -d -c typo3/sysext/core/Tests/codeception.yml --env=postgresql --xml reports.xml --html reports.html
mkdir -p typo3temp/var/tests/
if [ ${PHP_XDEBUG_ON} -eq 0 ]; then
XDEBUG_MODE=\"off\" \
bin/codecept run Install -d -c typo3/sysext/core/Tests/codeception.yml --env=postgresql --xml reports.xml --html reports.html
else
DOCKER_HOST=`route -n | awk '/^0.0.0.0/ { print $$2 }'`
XDEBUG_MODE=\"debug,develop\" \
XDEBUG_TRIGGER=\"foo\" \
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=$${DOCKER_HOST}\" \
bin/codecept run Install -d -c typo3/sysext/core/Tests/codeception.yml --env=postgresql --xml reports.xml --html reports.html
fi
"
prepare_acceptance_install_sqlite:
......@@ -343,8 +409,17 @@ services:
if [ ${SCRIPT_VERBOSE} -eq 1 ]; then
set -x
fi
mkdir -p typo3temp/var/tests/ \
&& php -dxdebug.mode=off bin/codecept run Install -d -c typo3/sysext/core/Tests/codeception.yml --env=sqlite --xml reports.xml --html reports.html
mkdir -p typo3temp/var/tests/
if [ ${PHP_XDEBUG_ON} -eq 0 ]; then
XDEBUG_MODE=\"off\" \
bin/codecept run Install -d -c typo3/sysext/core/Tests/codeception.yml --env=sqlite --xml reports.xml --html reports.html
else
DOCKER_HOST=`route -n | awk '/^0.0.0.0/ { print $$2 }'`
XDEBUG_MODE=\"debug,develop\" \
XDEBUG_TRIGGER=\"foo\" \
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=$${DOCKER_HOST}\" \
bin/codecept run Install -d -c typo3/sysext/core/Tests/codeception.yml --env=sqlite --xml reports.xml --html reports.html
fi
"
build_css:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment