From 199e0da3ed4bbbcdda5accc6c8cc48481ddb9bff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BCrk?= <stefan@buerk.tech> Date: Fri, 10 Jun 2022 16:13:43 +0200 Subject: [PATCH] [TASK] Add support for PHP8.2 to Build/Scripts/runTests.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch adds the ability to run commands with PHP8.2 using `Build/Scripts/runTests.sh`. Support is added early to check which issues may raise up with new major PHP version. Help text of script is adopted to state the possibilty of the new PHP version with proper example commands. Additionally a note and check for currently not suppored xdebug with PHP8.2 is added. Resolves: #97755 Releases: main, 11.5 Change-Id: I9df13d35278793fba8c5475c8abd602bd1c27896 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74870 Tested-by: core-ci <typo3@b13.com> Tested-by: Stefan Bürk <stefan@buerk.tech> Reviewed-by: Stefan Bürk <stefan@buerk.tech> --- Build/Scripts/runTests.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Build/Scripts/runTests.sh b/Build/Scripts/runTests.sh index 0c8314a3fe55..1ccf65eb24c9 100755 --- a/Build/Scripts/runTests.sh +++ b/Build/Scripts/runTests.sh @@ -115,6 +115,7 @@ cleanTestFiles() { } # Load help text into $HELP +# @todo Remove xdebug / php8.2 note after PHP8.2 image contains working xdebug. read -r -d '' HELP <<EOF TYPO3 core test runner. Execute acceptance, unit, functional and other test suites in a docker based test environment. Handles execution of single test files, sending @@ -226,11 +227,12 @@ Options: Hack functional or acceptance tests into #numberOfChunks pieces and run tests of #chunk. Example -c 3/13 - -p <7.4|8.0|8.1> + -p <7.4|8.0|8.1|8.2> Specifies the PHP minor version to be used - 7.4: (default) use PHP 7.4 - 8.0: use PHP 8.0 - 8.1: use PHP 8.1 + - 8.2: use PHP 8.2 (note that xdebug is currently not available for PHP8.2) -e "<phpunit options>" Only with -s functional|functionalDeprecated|unit|unitDeprecated|unitRandom|acceptance @@ -418,7 +420,7 @@ while getopts ":a:s:c:d:i:j:k:p:e:xy:o:nhuv" OPT; do ;; p) PHP_VERSION=${OPTARG} - if ! [[ ${PHP_VERSION} =~ ^(7.4|8.0|8.1)$ ]]; then + if ! [[ ${PHP_VERSION} =~ ^(7.4|8.0|8.1|8.2)$ ]]; then INVALID_OPTIONS+=("${OPTARG}") fi ;; @@ -456,6 +458,12 @@ while getopts ":a:s:c:d:i:j:k:p:e:xy:o:nhuv" OPT; do esac done +# @todo Remove this check after PHP8.2 image contains xdebug +if [ "${PHP_VERSION}" == "8.2" -a ${PHP_XDEBUG_ON} -eq 1 ]; then + echo "xdebug not available for PHP 8.2; either use other PHP version or do not use -x" + exit 1 +fi + # Exit on invalid options if [ ${#INVALID_OPTIONS[@]} -ne 0 ]; then echo "Invalid option(s):" >&2 -- GitLab