Commit d9fb666a authored by Christian Kuhn's avatar Christian Kuhn
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, 10.4, 9.5
Change-Id: Ia3f5a518089be675e33ddc673ebd4c99b2dbfaf6
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/70174


Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 1bac9f91
......@@ -150,14 +150,14 @@ Options:
- 8.0: use PHP 8.0
-e "<phpunit or codeception options>"
Only with -s functional|unit|unitDeprecated|unitRandom|acceptance
Only with -s functional|unit|unitDeprecated|unitRandom|acceptance|install
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 "-".
Example -e "-v --filter canRetrieveValueWithGP" to enable verbose output AND filter tests
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
......
......@@ -38,7 +38,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
......@@ -98,7 +110,16 @@ services:
COMMAND=\"bin/codecept run Backend -d -c typo3/sysext/core/Tests/codeception.yml ${EXTRA_TEST_OPTIONS} ${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:
......@@ -145,7 +166,16 @@ services:
COMMAND=\"bin/codecept run Backend -d -c typo3/sysext/core/Tests/codeception.yml ${EXTRA_TEST_OPTIONS} ${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:
......@@ -195,7 +225,16 @@ services:
COMMAND=\"bin/codecept run Backend -d -c typo3/sysext/core/Tests/codeception.yml ${EXTRA_TEST_OPTIONS} ${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:
......@@ -234,8 +273,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 ${EXTRA_TEST_OPTIONS} --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 ${EXTRA_TEST_OPTIONS} --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 ${EXTRA_TEST_OPTIONS} --env=mysql --xml reports.xml --html reports.html
fi
"
prepare_acceptance_install_mariadb:
......@@ -274,8 +322,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 ${EXTRA_TEST_OPTIONS} --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 ${EXTRA_TEST_OPTIONS} --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 ${EXTRA_TEST_OPTIONS} --env=mysql --xml reports.xml --html reports.html
fi
"
prepare_acceptance_install_postgres:
......@@ -314,8 +371,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 ${EXTRA_TEST_OPTIONS} --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 ${EXTRA_TEST_OPTIONS} --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 ${EXTRA_TEST_OPTIONS} --env=postgresql --xml reports.xml --html reports.html
fi
"
prepare_acceptance_install_sqlite:
......@@ -341,8 +407,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 ${EXTRA_TEST_OPTIONS} --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 ${EXTRA_TEST_OPTIONS} --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 ${EXTRA_TEST_OPTIONS} --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