From 63ac37134d32351e7d39afb332be237a7c34941d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BCrk?= Date: Thu, 5 Dec 2024 13:43:31 +0100 Subject: [PATCH 1/5] [TASK] Adjust `typo3/testing-framework` constraint The composer package version constraint for the `typo3/testing-framework` is adjusted to ensure latest version for each required major versions. Used command(s): ```shell composer require --dev --no-update \ 'typo3/testing-framework':'^7.1.1 || ^8.2.7' ``` [1] https://github.com/TYPO3/testing-framework/releases/tag/8.2.7 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 70091fb3..0c39a16d 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ "typo3/cms-fluid-styled-content": "^11.5 || ^12.4 || ^13.4", "typo3/cms-info": "^11.5 || ^12.4 || ^13.4", "typo3/cms-workspaces": "^11.5 || ^12.4 || ^13.4", - "typo3/testing-framework": "^7.0 || ^8.0", + "typo3/testing-framework": "^7.1.1 || ^8.2.7", "phpstan/phpstan": "^1.10", "typo3/coding-standards": "^0.5.5", "friendsofphp/php-cs-fixer": "^3.51", From a251dff644d66d8d1c0d16a913e209fa38316aab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BCrk?= Date: Thu, 5 Dec 2024 13:57:15 +0100 Subject: [PATCH 2/5] [TASK] Remove providing backend entrypoint for TYPO3 v13 in test instance TYPO3 v13.0 dropped the backend entrypoint (`./typo3/index.php`) and made the main entrypoint (`./index.php`) capable of handling frontend and backend web requests to make the backend entrypoint finally configurable and required to change the rewrite rules for webservers to ensure backend requests hits the main entrypoint. The acceptance setup for `b13/container` is based on the TYPO3 monorepo setup using a real `Apache2` webserver instead of the PHP internal webserver and thus needs `.htaccess` rules to work. Providing needed `.htaccess` files has been added to the TYPO3 monorepo only and broke the setup for acceptance testing against TYPO3 v13. As a workaround providing the old backend entrypoint file has been implemented within the extended codeception setup method `BackendContainerEnvironment::bootstrapTypo3Environment()` which worked but is literally wrong. `typo3/testing-framework` now provides these files automatically, and the wrong workaround can be removed to cleanup the code base [1][2][3][4] and is backwards compatible for older TYPO3 versions. Some phpstan ignore pattern can be now removed from baselines and is done in the same run. [1] https://github.com/TYPO3/testing-framework/pull/663 [2] https://github.com/TYPO3/testing-framework/pull/664 [3] https://github.com/TYPO3/testing-framework/releases/tag/9.1.2 [4] https://github.com/TYPO3/testing-framework/releases/tag/8.2.7 --- Build/phpstan-baseline-11-7.4.neon | 10 ---------- Build/phpstan-baseline-11.neon | 10 ---------- Build/phpstan-baseline-12.neon | 5 ----- Build/phpstan-baseline-13.neon | 5 ----- .../Extension/BackendContainerEnvironment.php | 18 ------------------ 5 files changed, 48 deletions(-) diff --git a/Build/phpstan-baseline-11-7.4.neon b/Build/phpstan-baseline-11-7.4.neon index 7abb344d..ca39e44e 100644 --- a/Build/phpstan-baseline-11-7.4.neon +++ b/Build/phpstan-baseline-11-7.4.neon @@ -35,16 +35,6 @@ parameters: count: 1 path: ../Tests/Acceptance/Support/Extension/BackendContainerEnvironment.php - - - message: "#^Call to an undefined static method TYPO3\\\\TestingFramework\\\\Core\\\\Acceptance\\\\Extension\\\\BackendEnvironment\\:\\:bootstrapTypo3Environment\\(\\)\\.$#" - count: 1 - path: ../Tests/Acceptance/Support/Extension/BackendContainerEnvironment.php - - - - message: "#^Constant ORIGINAL_ROOT not found\\.$#" - count: 1 - path: ../Tests/Acceptance/Support/Extension/BackendContainerEnvironment.php - - message: "#^Property TYPO3\\\\TestingFramework\\\\Core\\\\Acceptance\\\\Helper\\\\AbstractPageTree\\:\\:\\$tester \\(AcceptanceTester\\) does not accept B13\\\\Container\\\\Tests\\\\Acceptance\\\\Support\\\\BackendTester\\.$#" count: 1 diff --git a/Build/phpstan-baseline-11.neon b/Build/phpstan-baseline-11.neon index 6acd4ac7..89d06bde 100644 --- a/Build/phpstan-baseline-11.neon +++ b/Build/phpstan-baseline-11.neon @@ -35,16 +35,6 @@ parameters: count: 1 path: ../Tests/Acceptance/Support/Extension/BackendContainerEnvironment.php - - - message: "#^Call to an undefined static method TYPO3\\\\TestingFramework\\\\Core\\\\Acceptance\\\\Extension\\\\BackendEnvironment\\:\\:bootstrapTypo3Environment\\(\\)\\.$#" - count: 1 - path: ../Tests/Acceptance/Support/Extension/BackendContainerEnvironment.php - - - - message: "#^Constant ORIGINAL_ROOT not found\\.$#" - count: 1 - path: ../Tests/Acceptance/Support/Extension/BackendContainerEnvironment.php - - message: "#^Property TYPO3\\\\TestingFramework\\\\Core\\\\Acceptance\\\\Helper\\\\AbstractPageTree\\:\\:\\$tester \\(AcceptanceTester\\) does not accept B13\\\\Container\\\\Tests\\\\Acceptance\\\\Support\\\\BackendTester\\.$#" count: 1 diff --git a/Build/phpstan-baseline-12.neon b/Build/phpstan-baseline-12.neon index fccfb1af..075d14a6 100644 --- a/Build/phpstan-baseline-12.neon +++ b/Build/phpstan-baseline-12.neon @@ -30,11 +30,6 @@ parameters: count: 1 path: ../Tests/Acceptance/Support/BackendTester.php - - - message: "#^Constant ORIGINAL_ROOT not found\\.$#" - count: 1 - path: ../Tests/Acceptance/Support/Extension/BackendContainerEnvironment.php - - message: "#^Property TYPO3\\\\TestingFramework\\\\Core\\\\Acceptance\\\\Helper\\\\AbstractPageTree\\:\\:\\$tester \\(AcceptanceTester\\) does not accept B13\\\\Container\\\\Tests\\\\Acceptance\\\\Support\\\\BackendTester\\.$#" count: 1 diff --git a/Build/phpstan-baseline-13.neon b/Build/phpstan-baseline-13.neon index cef61e08..123b0cfc 100644 --- a/Build/phpstan-baseline-13.neon +++ b/Build/phpstan-baseline-13.neon @@ -45,11 +45,6 @@ parameters: count: 1 path: ../Tests/Acceptance/Support/BackendTester.php - - - message: "#^Constant ORIGINAL_ROOT not found\\.$#" - count: 1 - path: ../Tests/Acceptance/Support/Extension/BackendContainerEnvironment.php - - message: "#^Property TYPO3\\\\TestingFramework\\\\Core\\\\Acceptance\\\\Helper\\\\AbstractPageTree\\:\\:\\$tester \\(AcceptanceTester\\) does not accept B13\\\\Container\\\\Tests\\\\Acceptance\\\\Support\\\\BackendTester\\.$#" count: 1 diff --git a/Tests/Acceptance/Support/Extension/BackendContainerEnvironment.php b/Tests/Acceptance/Support/Extension/BackendContainerEnvironment.php index 79c0f3a8..e3319289 100644 --- a/Tests/Acceptance/Support/Extension/BackendContainerEnvironment.php +++ b/Tests/Acceptance/Support/Extension/BackendContainerEnvironment.php @@ -78,22 +78,4 @@ public function _initialize(): void } parent::_initialize(); } - - public function bootstrapTypo3Environment(SuiteEvent $suiteEvent): void - { - parent::bootstrapTypo3Environment($suiteEvent); - $typo3Version = GeneralUtility::makeInstance(Typo3Version::class); - if ($typo3Version->getMajorVersion() < 13) { - return; - } - $content = "get(\TYPO3\CMS\Backend\Http\Application::class)->run(); -});"; - $instancePath = ORIGINAL_ROOT . 'typo3temp/var/tests/acceptance'; - file_put_contents($instancePath . '/typo3/index.php', $content); - } } From d16573c58be1445e48963db6dcddcb7d7aae23ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BCrk?= Date: Thu, 5 Dec 2024 14:02:29 +0100 Subject: [PATCH 3/5] [TASK] Use composer package names for acceptance extension configuration `typo3/testing-framework` allows to use composer package names instead of classic mode references as extension to load for functional and codeception acceptance test instance creation. Use composer package names for acceptance test extensions to load now. --- .../Support/Extension/BackendContainerEnvironment.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Tests/Acceptance/Support/Extension/BackendContainerEnvironment.php b/Tests/Acceptance/Support/Extension/BackendContainerEnvironment.php index e3319289..d903e375 100644 --- a/Tests/Acceptance/Support/Extension/BackendContainerEnvironment.php +++ b/Tests/Acceptance/Support/Extension/BackendContainerEnvironment.php @@ -38,9 +38,9 @@ class BackendContainerEnvironment extends BackendEnvironment 'typo3conf/ext/container/Build/sites' => 'typo3conf/sites', ], 'testExtensionsToLoad' => [ - 'typo3conf/ext/container', - 'typo3conf/ext/container_example', - 'typo3conf/ext/content_defender', + 'b13/container', + 'b13/container-example', + 'ichhabrecht/content-defender', ], 'csvDatabaseFixtures' => [ __DIR__ . '/../../Fixtures/be_users.csv', @@ -72,8 +72,8 @@ public function _initialize(): void $typo3Version = GeneralUtility::makeInstance(Typo3Version::class); if ($typo3Version->getMajorVersion() === 13) { $this->localConfig['testExtensionsToLoad'] = [ - 'typo3conf/ext/container', - 'typo3conf/ext/container_example', + 'b13/container', + 'b13/container-example', ]; } parent::_initialize(); From 69d6894e517d5328f5dea0c113da3041c78ba155 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BCrk?= Date: Thu, 5 Dec 2024 14:23:16 +0100 Subject: [PATCH 4/5] [TASK] Adopt codeception helper login page check from testing-framework For the codeception acceptance tests a custom codeception helper is used to verify the login state, using `/typo3/index.php` to check for backend login mask page. Using the full endpoint is not reasonable and breaks with TYPO3 v13.0 and newer which removed that endpoint completly and this change modifes the check to use `/typo3` path instead, adopting from provided `typo3/testing-framework` helper which is fully backwards compatible. --- Tests/Acceptance/Support/BackendTester.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/Acceptance/Support/BackendTester.php b/Tests/Acceptance/Support/BackendTester.php index 6458f627..6a18e306 100644 --- a/Tests/Acceptance/Support/BackendTester.php +++ b/Tests/Acceptance/Support/BackendTester.php @@ -27,12 +27,12 @@ public function loginAs(string $username): void { $I = $this; if ($I->loadSessionSnapshot($username . 'Login')) { - $I->amOnPage('/typo3/index.php'); + $I->amOnPage('/typo3'); } else { - $I->amOnPage('/typo3/index.php'); + $I->amOnPage('/typo3'); $I->waitForElement('body[data-typo3-login-ready]'); // logging in - $I->amOnPage('/typo3/index.php'); + $I->amOnPage('/typo3'); $I->submitForm('#typo3-login-form', [ 'username' => $username, 'p_field' => 'password', From e8b73aef7fbeb7f384cf61413c3c1b866e430543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BCrk?= Date: Thu, 5 Dec 2024 15:05:24 +0100 Subject: [PATCH 5/5] [TASK] Use `apache2` and `PHP-FPM` for acceptance tests for TYPO3 v13 TYPO3 Core development switched codeception based acceptance testing using `apache2` and `PHP-FPM` instead if the internal PHP cli webserver due to rewrite rules required to operate TYPO3 properly, special with removed backend entrypoint since TYPO3 v13. This change adopts required changes within `Build/Scripts/runTests.sh` to make the switch and be in line with core development regarding acceptance testing for TYPO3 v13 only, keeping the PHP internal webserver for older TYPO3 core and testing-framework versions. --- Build/Scripts/runTests.sh | 55 ++++++++++++++++++++++++++++++++++----- Tests/codeception.yml | 2 +- Tests/parameters.yml | 3 +-- 3 files changed, 50 insertions(+), 10 deletions(-) diff --git a/Build/Scripts/runTests.sh b/Build/Scripts/runTests.sh index 293e12ce..626c9793 100755 --- a/Build/Scripts/runTests.sh +++ b/Build/Scripts/runTests.sh @@ -306,6 +306,8 @@ USERSET="" SUFFIX=$(echo $RANDOM) NETWORK="b13-container-${SUFFIX}" PHPUNIT_EXCLUDE_GROUPS="${PHPUNIT_EXCLUDE_GROUPS:-}" +# @todo Remove USE_APACHE option when TF7 has been dropped (along with TYPO3 v11 support). +USE_APACHE=0 # Option parsing updates above default vars # Reset in case getopts has been used previously in the shell @@ -338,6 +340,8 @@ while getopts "a:b:s:d:i:t:p:xy:o:nhug" OPT; do if ! [[ ${TYPO3} =~ ^(11|12|13)$ ]]; then INVALID_OPTIONS+=("${OPTARG}") fi + # @todo Remove USE_APACHE option when TF7 has been dropped (along with TYPO3 v11 support). + [[ "${TYPO3}" -eq 13 ]] && USE_APACHE=1 ;; p) PHP_VERSION=${OPTARG} @@ -481,17 +485,34 @@ case ${TEST_SUITE} in if [ "${ACCEPTANCE_HEADLESS}" -eq 0 ]; then SELENIUM_GRID="-p 7900:7900 -e SE_VNC_NO_PASSWORD=1 -e VNC_NO_PASSWORD=1" fi + APACHE_OPTIONS="-e APACHE_RUN_USER=#${HOST_UID} -e APACHE_RUN_SERVERNAME=web -e APACHE_RUN_GROUP=#${HOST_PID} -e APACHE_RUN_DOCROOT=${CORE_ROOT}/.Build/Web/typo3temp/var/tests/acceptance -e PHPFPM_HOST=phpfpm -e PHPFPM_PORT=9000 -e TYPO3_PATH_ROOT=${CORE_ROOT}/.Build/Web/typo3temp/var/tests/acceptance -e TYPO3_PATH_APP=${CORE_ROOT}/.Build/Web/typo3temp/var/tests/acceptance" ${CONTAINER_BIN} run --rm ${CI_PARAMS} -d ${SELENIUM_GRID} --name ac-chrome-${SUFFIX} --network ${NETWORK} --network-alias chrome --tmpfs /dev/shm:rw,nosuid,nodev,noexec ${IMAGE_SELENIUM} >/dev/null if [ ${CONTAINER_BIN} = "docker" ]; then - ${CONTAINER_BIN} run --rm ${CI_PARAMS} -d --name ac-web-${SUFFIX} --network ${NETWORK} --network-alias web --add-host "${CONTAINER_HOST}:host-gateway" ${USERSET} -v ${CORE_ROOT}:${CORE_ROOT} ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" -e TYPO3_PATH_ROOT=${CORE_ROOT}/.Build/Web/typo3temp/var/tests/acceptance -e TYPO3_PATH_APP=${CORE_ROOT}/.Build/Web/typo3temp/var/tests/acceptance ${IMAGE_PHP} php -S web:8000 -t ${CORE_ROOT}/.Build/Web/typo3temp/var/tests/acceptance >/dev/null + if [[ "${USE_APACHE}" -eq 1 ]]; then + ${CONTAINER_BIN} run --rm -d --name ac-phpfpm-${SUFFIX} --network ${NETWORK} --network-alias phpfpm --add-host "${CONTAINER_HOST}:host-gateway" ${USERSET} -e PHPFPM_USER=${HOST_UID} -e PHPFPM_GROUP=${HOST_PID} -e TYPO3_PATH_ROOT=${CORE_ROOT}/.Build/Web/typo3temp/var/tests/acceptance -e TYPO3_PATH_APP=${CORE_ROOT}/.Build/Web/typo3temp/var/tests/acceptance -v ${CORE_ROOT}:${CORE_ROOT} ${IMAGE_PHP} php-fpm ${PHP_FPM_OPTIONS} >/dev/null + ${CONTAINER_BIN} run --rm -d --name ac-web-${SUFFIX} --network ${NETWORK} --network-alias web --add-host "${CONTAINER_HOST}:host-gateway" -v ${CORE_ROOT}:${CORE_ROOT} ${APACHE_OPTIONS} ${IMAGE_APACHE} >/dev/null + else + # @todo Remove fallback when TF7 has been dropped (along with TYPO3 v11 support). + ${CONTAINER_BIN} run --rm ${CI_PARAMS} -d --name ac-web-${SUFFIX} --network ${NETWORK} --network-alias web --add-host "${CONTAINER_HOST}:host-gateway" ${USERSET} -v ${CORE_ROOT}:${CORE_ROOT} ${XDEBUG_MODE} -e typo3TestingAcceptanceBaseUrl=http://web:8000/ -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" -e TYPO3_PATH_ROOT=${CORE_ROOT}/.Build/Web/typo3temp/var/tests/acceptance -e TYPO3_PATH_APP=${CORE_ROOT}/.Build/Web/typo3temp/var/tests/acceptance ${IMAGE_PHP} php -S web:8000 -t ${CORE_ROOT}/.Build/Web/typo3temp/var/tests/acceptance >/dev/null + fi else - ${CONTAINER_BIN} run --rm ${CI_PARAMS} -d --name ac-web-${SUFFIX} --network ${NETWORK} --network-alias web -v ${CORE_ROOT}:${CORE_ROOT} ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" -e TYPO3_PATH_ROOT=${CORE_ROOT}/.Build/Web/typo3temp/var/tests/acceptance -e TYPO3_PATH_APP=${CORE_ROOT}/.Build/Web/typo3temp/var/tests/acceptance ${IMAGE_PHP} php -S web:8000 -t ${CORE_ROOT}/.Build/Web/typo3temp/var/tests/acceptance >/dev/null + if [[ "${USE_APACHE}" -eq 1 ]]; then + ${CONTAINER_BIN} run --rm ${CI_PARAMS} -d --name ac-phpfpm-${SUFFIX} --network ${NETWORK} --network-alias phpfpm ${USERSET} -e PHPFPM_USER=0 -e PHPFPM_GROUP=0 -e TYPO3_PATH_ROOT=${CORE_ROOT}/.Build/Web/typo3temp/var/tests/acceptance -e TYPO3_PATH_APP=${CORE_ROOT}/.Build/Web/typo3temp/var/tests/acceptance -v ${CORE_ROOT}:${CORE_ROOT} ${IMAGE_PHP} php-fpm -R ${PHP_FPM_OPTIONS} >/dev/null + ${CONTAINER_BIN} run --rm ${CI_PARAMS} -d --name ac-web-${SUFFIX} --network ${NETWORK} --network-alias web -v ${CORE_ROOT}:${CORE_ROOT} ${APACHE_OPTIONS} ${IMAGE_APACHE} >/dev/null + else + # @todo Remove fallback when TF7 has been dropped (along with TYPO3 v11 support). + ${CONTAINER_BIN} run --rm ${CI_PARAMS} -d --name ac-web-${SUFFIX} --network ${NETWORK} --network-alias web -v ${CORE_ROOT}:${CORE_ROOT} ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" -e typo3TestingAcceptanceBaseUrl=http://web:8000/ -e TYPO3_PATH_ROOT=${CORE_ROOT}/.Build/Web/typo3temp/var/tests/acceptance -e TYPO3_PATH_APP=${CORE_ROOT}/.Build/Web/typo3temp/var/tests/acceptance ${IMAGE_PHP} php -S web:8000 -t ${CORE_ROOT}/.Build/Web/typo3temp/var/tests/acceptance >/dev/null + fi fi waitFor chrome 4444 if [ "${ACCEPTANCE_HEADLESS}" -eq 0 ]; then waitFor chrome 7900 fi - waitFor web 8000 + if [[ "${USE_APACHE}" -eq 1 ]]; then + waitFor web 80 + else + waitFor web 8000 + fi if [ "${ACCEPTANCE_HEADLESS}" -eq 0 ] && type "xdg-open" >/dev/null; then xdg-open http://localhost:7900/?autoconnect=1 >/dev/null elif [ "${ACCEPTANCE_HEADLESS}" -eq 0 ] && type "open" >/dev/null; then @@ -502,7 +523,12 @@ case ${TEST_SUITE} in ${CONTAINER_BIN} run --rm ${CI_PARAMS} --name mariadb-ac-${SUFFIX} --network ${NETWORK} -d -e MYSQL_ROOT_PASSWORD=funcp --tmpfs /var/lib/mysql/:rw,noexec,nosuid ${IMAGE_MARIADB} >/dev/null DATABASE_IP=$(${CONTAINER_BIN} inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' mariadb-ac-${SUFFIX}) waitFor mariadb-ac-${SUFFIX} 3306 - CONTAINERPARAMS="-e typo3DatabaseName=func_test -e typo3DatabaseUsername=root -e typo3DatabasePassword=funcp -e typo3DatabaseHost=${DATABASE_IP}" + if [[ "${USE_APACHE}" -eq 1 ]]; then + CONTAINERPARAMS="-e typo3DatabaseName=func_test -e typo3DatabaseUsername=root -e typo3DatabasePassword=funcp -e typo3DatabaseHost=${DATABASE_IP}" + else + # @todo Remove fallback when TF7 has been dropped (along with TYPO3 v11 support). + CONTAINERPARAMS="-e typo3DatabaseName=func_test -e typo3DatabaseUsername=root -e typo3DatabasePassword=funcp -e typo3DatabaseHost=${DATABASE_IP} -e typo3TestingAcceptanceBaseUrl=http://web:8000" + fi ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name ac-mariadb ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${CONTAINERPARAMS} ${IMAGE_PHP} "${COMMAND[@]}" SUITE_EXIT_CODE=$? ;; @@ -510,7 +536,12 @@ case ${TEST_SUITE} in ${CONTAINER_BIN} run --rm ${CI_PARAMS} --name mysql-ac-${SUFFIX} --network ${NETWORK} -d -e MYSQL_ROOT_PASSWORD=funcp --tmpfs /var/lib/mysql/:rw,noexec,nosuid ${IMAGE_MYSQL} >/dev/null DATABASE_IP=$(${CONTAINER_BIN} inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' mysql-ac-${SUFFIX}) waitFor mysql-ac-${SUFFIX} 3306 2 - CONTAINERPARAMS="-e typo3DatabaseName=func_test -e typo3DatabaseUsername=root -e typo3DatabasePassword=funcp -e typo3DatabaseHost=${DATABASE_IP}" + if [[ "${USE_APACHE}" -eq 1 ]]; then + CONTAINERPARAMS="-e typo3DatabaseName=func_test -e typo3DatabaseUsername=root -e typo3DatabasePassword=funcp -e typo3DatabaseHost=${DATABASE_IP}" + else + # @todo Remove fallback when TF7 has been dropped (along with TYPO3 v11 support). + CONTAINERPARAMS="-e typo3DatabaseName=func_test -e typo3DatabaseUsername=root -e typo3DatabasePassword=funcp -e typo3DatabaseHost=${DATABASE_IP} -e typo3TestingAcceptanceBaseUrl=http://web:8000" + fi ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name ac-mysql ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${CONTAINERPARAMS} ${IMAGE_PHP} "${COMMAND[@]}" SUITE_EXIT_CODE=$? ;; @@ -518,14 +549,24 @@ case ${TEST_SUITE} in ${CONTAINER_BIN} run --rm ${CI_PARAMS} --name postgres-ac-${SUFFIX} --network ${NETWORK} -d -e POSTGRES_PASSWORD=funcp -e POSTGRES_USER=funcu --tmpfs /var/lib/postgresql/data:rw,noexec,nosuid ${IMAGE_POSTGRES} >/dev/null DATABASE_IP=$(${CONTAINER_BIN} inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' postgres-ac-${SUFFIX}) waitFor postgres-ac-${SUFFIX} 5432 - CONTAINERPARAMS="-e typo3DatabaseDriver=pdo_pgsql -e typo3DatabaseName=func_test -e typo3DatabaseUsername=funcu -e typo3DatabasePassword=funcp -e typo3DatabaseHost=${DATABASE_IP}" + if [[ "${USE_APACHE}" -eq 1 ]]; then + CONTAINERPARAMS="-e typo3DatabaseDriver=pdo_pgsql -e typo3DatabaseName=func_test -e typo3DatabaseUsername=funcu -e typo3DatabasePassword=funcp -e typo3DatabaseHost=${DATABASE_IP}" + else + # @todo Remove fallback when TF7 has been dropped (along with TYPO3 v11 support). + CONTAINERPARAMS="-e typo3DatabaseDriver=pdo_pgsql -e typo3DatabaseName=func_test -e typo3DatabaseUsername=funcu -e typo3DatabasePassword=funcp -e typo3DatabaseHost=${DATABASE_IP} -e typo3TestingAcceptanceBaseUrl=http://web:8000" + fi ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name ac-postgres ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${CONTAINERPARAMS} ${IMAGE_PHP} "${COMMAND[@]}" SUITE_EXIT_CODE=$? ;; sqlite) rm -rf "${CORE_ROOT}/typo3temp/var/tests/acceptance-sqlite-dbs/" mkdir -p "${CORE_ROOT}/typo3temp/var/tests/acceptance-sqlite-dbs/" - CONTAINERPARAMS="-e typo3DatabaseDriver=pdo_sqlite" + if [[ "${USE_APACHE}" -eq 1 ]]; then + CONTAINERPARAMS="-e typo3DatabaseDriver=pdo_sqlite" + else + # @todo Remove fallback when TF7 has been dropped (along with TYPO3 v11 support). + CONTAINERPARAMS="-e typo3DatabaseDriver=pdo_sqlite -e typo3TestingAcceptanceBaseUrl=http://web:8000" + fi ${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name ac-sqlite ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${CONTAINERPARAMS} ${IMAGE_PHP} "${COMMAND[@]}" SUITE_EXIT_CODE=$? ;; diff --git a/Tests/codeception.yml b/Tests/codeception.yml index 8ee4f031..0bb39cb1 100644 --- a/Tests/codeception.yml +++ b/Tests/codeception.yml @@ -48,7 +48,7 @@ env: config: WebDriver: path: /wd/hub - url: 'http://0.0.0.0:8888/' + url: 'http://0.0.0.0:80/' capabilities: goog:chromeOptions: args: ["no-sandbox", "disable-gpu"] diff --git a/Tests/parameters.yml b/Tests/parameters.yml index f9f3cdc6..438ada0b 100644 --- a/Tests/parameters.yml +++ b/Tests/parameters.yml @@ -3,5 +3,4 @@ # These values can be overridden by environment variables, # e.g. in Build/Scripts/runTest.sh # -#typo3TestingAcceptanceBaseUrl: http://web:8000/typo3temp/var/tests/acceptance/ -typo3TestingAcceptanceBaseUrl: http://web:8000/ \ No newline at end of file +typo3TestingAcceptanceBaseUrl: http://web:80 \ No newline at end of file