mirror of https://github.com/FriendsOfTYPO3/tea.git synced 2024-11-24 13:56:12 +01:00
tea/Build/Scripts/runTests.sh

711 lines
30 KiB
Bash
Raw Normal View History

[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
#!/usr/bin/env bash
#
# TYPO3 extension tea test runner based on docker.
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
#
if [ "${CI}" != "true" ]; then
trap 'echo "runTests.sh SIGINT signal emitted";cleanUp;exit 2' SIGINT
fi
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
waitFor() {
local HOST=${1}
local PORT=${2}
local TESTCOMMAND="
COUNT=0;
while ! nc -z ${HOST} ${PORT}; do
if [ \"\${COUNT}\" -gt 20 ]; then
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
echo \"Can not connect to ${HOST} port ${PORT}. Aborting.\";
exit 1;
fi;
sleep 1;
COUNT=\$((COUNT + 1));
done;
"
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name wait-for-${SUFFIX} ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${IMAGE_ALPINE} /bin/sh -c "${TESTCOMMAND}"
# shellcheck disable=SC2181 # Disabled because we dont want to move the long line between the brackets
if [[ $? -gt 0 ]]; then
kill -SIGINT -$$
fi
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
}
cleanUp() {
ATTACHED_CONTAINERS=$(${CONTAINER_BIN} ps --filter network=${NETWORK} --format='{{.Names}}')
for ATTACHED_CONTAINER in ${ATTACHED_CONTAINERS}; do
[TASK] Add `-b` option to select container binary (#1076) TYPO3 core introduced the `-b` option for the `Build/Scripts/runTests.sh` script to provide the ability to select the container binary, `docker` or `podman` and enforces podman for CI (GitLab runner) runs after switching the Core CI infrastructure from Docker-In-Docker to Podman-In-Podman. The `ext:tea` adoption of the `runTests.sh` has been already adopted on a intermediate version and dropped the `docker-compose` based container definitions. Along with other minor prepration patches this allows now to add the container binary selection also. This change modifies `runTests.sh` to * add the `-b` option with a corresponding helptext addition and allows `podman` or `docker` - whereas the latter is the default. * integrates the determined and fixed issues with tty in CI environments by setting some paramater for the commands based on the CI detection (GitHub Action or GitLab Runner). Note: The implemention for `ext:tea` does not enforce hardcoed the `podman` binary for CI environments. If no user selection is provided, it fallbacks to `docker` for all environments. It's worth to mention that the implementation to deal properly with user namespacing and permission handling on mountend volumns it's required to have at least `podman 4.x` installed. Earlier versions does not support the required handlinging and options. Minor moving of variable declaration are done as a drive-by change. The `docsGenerate` suite has been guard and display a concrete message when executed using the `podman` binary. Resolves: #1075 Related: #969
2023-12-18 23:41:14 +01:00
${CONTAINER_BIN} kill ${ATTACHED_CONTAINER} >/dev/null
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
done
${CONTAINER_BIN} network rm ${NETWORK} >/dev/null
}
handleDbmsOptions() {
# -a, -d, -i depend on each other. Validate input combinations and set defaults.
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
case ${DBMS} in
mariadb)
[ -z "${DATABASE_DRIVER}" ] && DATABASE_DRIVER="mysqli"
if [ "${DATABASE_DRIVER}" != "mysqli" ] && [ "${DATABASE_DRIVER}" != "pdo_mysql" ]; then
echo "Invalid combination -d ${DBMS} -a ${DATABASE_DRIVER}" >&2
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
echo >&2
echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2
exit 1
fi
[ -z "${DBMS_VERSION}" ] && DBMS_VERSION="10.3"
if ! [[ ${DBMS_VERSION} =~ ^(10.3|10.4|10.5|10.6|10.7|10.8|10.9|10.10|10.11|11.0|11.1)$ ]]; then
echo "Invalid combination -d ${DBMS} -i ${DBMS_VERSION}" >&2
echo >&2
echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
exit 1
fi
;;
mysql)
[ -z "${DATABASE_DRIVER}" ] && DATABASE_DRIVER="mysqli"
if [ "${DATABASE_DRIVER}" != "mysqli" ] && [ "${DATABASE_DRIVER}" != "pdo_mysql" ]; then
echo "Invalid combination -d ${DBMS} -a ${DATABASE_DRIVER}" >&2
echo >&2
echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2
exit 1
fi
[ -z "${DBMS_VERSION}" ] && DBMS_VERSION="8.0"
if ! [[ ${DBMS_VERSION} =~ ^(5.5|5.6|5.7|8.0)$ ]]; then
echo "Invalid combination -d ${DBMS} -i ${DBMS_VERSION}" >&2
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
echo >&2
echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
exit 1
fi
;;
postgres)
if [ -n "${DATABASE_DRIVER}" ]; then
echo "Invalid combination -d ${DBMS} -a ${DATABASE_DRIVER}" >&2
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
echo >&2
echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2
exit 1
fi
[ -z "${DBMS_VERSION}" ] && DBMS_VERSION="10"
if ! [[ ${DBMS_VERSION} =~ ^(10|11|12|13|14|15|16)$ ]]; then
echo "Invalid combination -d ${DBMS} -i ${DBMS_VERSION}" >&2
echo >&2
echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
exit 1
fi
;;
sqlite)
if [ -n "${DATABASE_DRIVER}" ]; then
echo "Invalid combination -d ${DBMS} -a ${DATABASE_DRIVER}" >&2
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
echo >&2
echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2
exit 1
fi
if [ -n "${DBMS_VERSION}" ]; then
echo "Invalid combination -d ${DBMS} -i ${DATABASE_DRIVER}" >&2
echo >&2
echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
exit 1
fi
;;
*)
echo "Invalid option -d ${DBMS}" >&2
echo >&2
echo "Use \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
exit 1
;;
esac
}
cleanCacheFiles() {
echo -n "Clean caches ... "
rm -rf \
.Build/.cache \
.php-cs-fixer.cache
echo "done"
}
cleanTestFiles() {
# test related
echo -n "Clean test related files ... "
rm -rf \
.Build/public/typo3temp/var/tests/
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
echo "done"
}
cleanRenderedDocumentationFiles() {
echo -n "Clean rendered documentation files ... "
rm -rf \
Documentation-GENERATED-temp
echo "done"
}
loadHelp() {
# Load help text into $HELP
read -r -d '' HELP <<EOF
TYPO3 core test runner. Execute unit, functional and other test suites in
a container based test environment. Handles execution of single test files,
sending xdebug information to a local IDE and more.
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
Usage: $0 [options] [file]
Options:
-s <...>
Specifies which test suite to run
- cgl: Fixes the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer).
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
- clean: clean up build, cache and testing related files and folders
- cleanCache: clean up cache related files and folders
- cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp)
- cleanTests: clean up test related files and folders
- composer: "composer" with all remaining arguments dispatched.
- composerNormalize: Normalizes the composer.json.
- composerUnused: Finds unused Composer packages.
- composerUpdateMax: "composer update", with no platform.php config.
- composerUpdateMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0.
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
- docsGenerate: Renders the extension ReST documentation.
- functional: PHP functional tests
- lintCss: CSS file linting. Set -n for dry-run.
- lintJs: JavaScript file linting. Set -n for dry-run.
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
- lintJson: JSON linting
- lintPhp: PHP linting
- lintTypoScript: TypoScript linting
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
- lintYaml: YAML linting
- npm: "npm" with all remaining arguments dispatched.
- phpstan: PHPStan tests
- phpstanGenerateBaseline: regenerate PHPStan baseline, handy after PHPStan updates
- shellcheck: check runTests.sh for shell issues
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
- unit (default): PHP unit tests
- unitRandom: PHP unit tests in random order, add -o <number> to use specific seed
- update: Updates existing typo3/core-testing-*:latest container images and removes dangling local volumes.
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
-a <mysqli|pdo_mysql>
Only with -s functional|functionalDeprecated
Specifies to use another driver, following combinations are available:
- mysql
- mysqli (default)
- pdo_mysql
- mariadb
- mysqli (default)
- pdo_mysql
[TASK] Add `-b` option to select container binary (#1076) TYPO3 core introduced the `-b` option for the `Build/Scripts/runTests.sh` script to provide the ability to select the container binary, `docker` or `podman` and enforces podman for CI (GitLab runner) runs after switching the Core CI infrastructure from Docker-In-Docker to Podman-In-Podman. The `ext:tea` adoption of the `runTests.sh` has been already adopted on a intermediate version and dropped the `docker-compose` based container definitions. Along with other minor prepration patches this allows now to add the container binary selection also. This change modifies `runTests.sh` to * add the `-b` option with a corresponding helptext addition and allows `podman` or `docker` - whereas the latter is the default. * integrates the determined and fixed issues with tty in CI environments by setting some paramater for the commands based on the CI detection (GitHub Action or GitLab Runner). Note: The implemention for `ext:tea` does not enforce hardcoed the `podman` binary for CI environments. If no user selection is provided, it fallbacks to `docker` for all environments. It's worth to mention that the implementation to deal properly with user namespacing and permission handling on mountend volumns it's required to have at least `podman 4.x` installed. Earlier versions does not support the required handlinging and options. Minor moving of variable declaration are done as a drive-by change. The `docsGenerate` suite has been guard and display a concrete message when executed using the `podman` binary. Resolves: #1075 Related: #969
2023-12-18 23:41:14 +01:00
-b <docker|podman>
Container environment:
- docker (default)
- podman
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
-d <sqlite|mariadb|mysql|postgres>
Only with -s functional|functionalDeprecated
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
Specifies on which DBMS tests are performed
- mariadb: use mariadb
- mysql: use MySQL
- postgres: use postgres
- sqlite: (default): use sqlite
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
-i version
Specify a specific database version
With "-d mariadb":
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
- 10.3 short-term, maintained until 2023-05-25 (default)
- 10.4 short-term, maintained until 2024-06-18
- 10.5 short-term, maintained until 2025-06-24
- 10.6 long-term, maintained until 2026-06
- 10.7 short-term, no longer maintained
- 10.8 short-term, maintained until 2023-05
- 10.9 short-term, maintained until 2023-08
- 10.10 short-term, maintained until 2023-11
- 10.11 long-term, maintained until 2028-02
- 11.0 development series
- 11.1 short-term development series
With "-d mysql":
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
- 5.5 unmaintained since 2018-12
- 5.6 unmaintained since 2021-02
- 5.7 maintained until 2023-10
- 8.0 maintained until 2026-04 (default)
With "-d postgres":
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
- 10 unmaintained since 2022-11-10 (default)
- 11 unmaintained since 2023-11-09
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
- 12 maintained until 2024-11-14
- 13 maintained until 2025-11-13
- 14 maintained until 2026-11-12
- 15 maintained until 2027-11-11
- 16 maintained until 2028-11-09
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
-t <11.5|12.4>
Only with -s composerUpdateMin|composerUpdateMax
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
Specifies the TYPO3 CORE Version to be used
- 11.5: use TYPO3 v11 with typo3/cms-composer-installers ^3
- 12.4: (default) use TYPO3 v12 with typo3/cms-composer-installers ^5
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
-p <7.4|8.0|8.1|8.2|8.3|8.4>
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
Specifies the PHP minor version to be used
- 7.4: use PHP 7.4
- 8.0: use PHP 8.0
- 8.1: use PHP 8.1
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
- 8.2: use PHP 8.2
- 8.3: (default) use PHP 8.3
- 8.4: use PHP 8.4
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
-e "<phpunit options>"
Only with -s functional|functionalDeprecated|unit|unitDeprecated|unitRandom
Additional options to send to phpunit (unit & functional tests). For phpunit,
options starting with "--" must be added after options starting with "-".
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
Example -e "-v --filter canRetrieveValueWithGP" to enable verbose output AND filter tests
named "canRetrieveValueWithGP"
-x
Only with -s functional|functionalDeprecated|unit|unitDeprecated|unitRandom
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
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
-y <port>
Send xdebug information to a different port than default 9003 if an IDE like PhpStorm
is not listening on default port.
-o <number>
Only with -s unitRandom
Set specific random seed to replay a random run in this order again. The phpunit randomizer
outputs the used seed at the end (in gitlab core testing logs, too). Use that number to
replay the unit tests in that order.
-n
Only with -s cgl|composerNormalize|npm|lintJs|lintCss
Activate dry-run in checks so they do not actively change files and only print broken ones.
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
-u
Update existing typo3/core-testing-*:latest container images and remove dangling local volumes.
New images are published once in a while and only the latest ones are supported by core testing.
Use this if weird test errors occur. Also removes obsolete image versions of typo3/core-testing-*.
-h
Show this help.
Examples:
# Run all core unit tests using PHP 8.3
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
./Build/Scripts/runTests.sh
./Build/Scripts/runTests.sh -s unit
# Run all core units tests and enable xdebug (have a PhpStorm listening on port 9003!)
./Build/Scripts/runTests.sh -x
# Run unit tests in phpunit verbose mode with xdebug on PHP 8.1 and filter for test canRetrieveValueWithGP
./Build/Scripts/runTests.sh -x -p 8.1 -e "-v --filter canRetrieveValueWithGP"
# Run functional tests in phpunit with a filtered test method name in a specified file
# example will currently execute two tests, both of which start with the search term
./Build/Scripts/runTests.sh -s functional -e "--filter deleteContent" typo3/sysext/core/Tests/Functional/DataHandling/Regular/Modify/ActionTest.php
# Run functional tests on postgres with xdebug, php 8.1 and execute a restricted set of tests
./Build/Scripts/runTests.sh -x -p 8.1 -s functional -d postgres typo3/sysext/core/Tests/Functional/Authentication
# Run functional tests on postgres 11
./Build/Scripts/runTests.sh -s functional -d postgres -i 11
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
EOF
}
# Test if at least one of the supported container binaries exists, else exit out with error
[TASK] Add `-b` option to select container binary (#1076) TYPO3 core introduced the `-b` option for the `Build/Scripts/runTests.sh` script to provide the ability to select the container binary, `docker` or `podman` and enforces podman for CI (GitLab runner) runs after switching the Core CI infrastructure from Docker-In-Docker to Podman-In-Podman. The `ext:tea` adoption of the `runTests.sh` has been already adopted on a intermediate version and dropped the `docker-compose` based container definitions. Along with other minor prepration patches this allows now to add the container binary selection also. This change modifies `runTests.sh` to * add the `-b` option with a corresponding helptext addition and allows `podman` or `docker` - whereas the latter is the default. * integrates the determined and fixed issues with tty in CI environments by setting some paramater for the commands based on the CI detection (GitHub Action or GitLab Runner). Note: The implemention for `ext:tea` does not enforce hardcoed the `podman` binary for CI environments. If no user selection is provided, it fallbacks to `docker` for all environments. It's worth to mention that the implementation to deal properly with user namespacing and permission handling on mountend volumns it's required to have at least `podman 4.x` installed. Earlier versions does not support the required handlinging and options. Minor moving of variable declaration are done as a drive-by change. The `docsGenerate` suite has been guard and display a concrete message when executed using the `podman` binary. Resolves: #1075 Related: #969
2023-12-18 23:41:14 +01:00
if ! type "docker" >/dev/null 2>&1 && ! type "podman" >/dev/null 2>&1; then
echo "This script relies on docker or podman. Please install at least one of them" >&2
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
exit 1
fi
[TASK] Add `-b` option to select container binary (#1076) TYPO3 core introduced the `-b` option for the `Build/Scripts/runTests.sh` script to provide the ability to select the container binary, `docker` or `podman` and enforces podman for CI (GitLab runner) runs after switching the Core CI infrastructure from Docker-In-Docker to Podman-In-Podman. The `ext:tea` adoption of the `runTests.sh` has been already adopted on a intermediate version and dropped the `docker-compose` based container definitions. Along with other minor prepration patches this allows now to add the container binary selection also. This change modifies `runTests.sh` to * add the `-b` option with a corresponding helptext addition and allows `podman` or `docker` - whereas the latter is the default. * integrates the determined and fixed issues with tty in CI environments by setting some paramater for the commands based on the CI detection (GitHub Action or GitLab Runner). Note: The implemention for `ext:tea` does not enforce hardcoed the `podman` binary for CI environments. If no user selection is provided, it fallbacks to `docker` for all environments. It's worth to mention that the implementation to deal properly with user namespacing and permission handling on mountend volumns it's required to have at least `podman 4.x` installed. Earlier versions does not support the required handlinging and options. Minor moving of variable declaration are done as a drive-by change. The `docsGenerate` suite has been guard and display a concrete message when executed using the `podman` binary. Resolves: #1075 Related: #969
2023-12-18 23:41:14 +01:00
# Go to the directory this script is located, so everything else is relative
# to this dir, no matter from where this script is called, then go up two dirs.
THIS_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
cd "$THIS_SCRIPT_DIR" || exit 1
cd ../../ || exit 1
ROOT_DIR="${PWD}"
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
# Option defaults
TEST_SUITE="unit"
CORE_VERSION="12.4"
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
DBMS="sqlite"
DBMS_VERSION=""
PHP_VERSION="8.3"
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
PHP_XDEBUG_ON=0
PHP_XDEBUG_PORT=9003
EXTRA_TEST_OPTIONS=""
PHPUNIT_RANDOM=""
# CGLCHECK_DRY_RUN is a more generic dry-run switch not limited to CGL
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
CGLCHECK_DRY_RUN=0
DATABASE_DRIVER=""
[TASK] Add `-b` option to select container binary (#1076) TYPO3 core introduced the `-b` option for the `Build/Scripts/runTests.sh` script to provide the ability to select the container binary, `docker` or `podman` and enforces podman for CI (GitLab runner) runs after switching the Core CI infrastructure from Docker-In-Docker to Podman-In-Podman. The `ext:tea` adoption of the `runTests.sh` has been already adopted on a intermediate version and dropped the `docker-compose` based container definitions. Along with other minor prepration patches this allows now to add the container binary selection also. This change modifies `runTests.sh` to * add the `-b` option with a corresponding helptext addition and allows `podman` or `docker` - whereas the latter is the default. * integrates the determined and fixed issues with tty in CI environments by setting some paramater for the commands based on the CI detection (GitHub Action or GitLab Runner). Note: The implemention for `ext:tea` does not enforce hardcoed the `podman` binary for CI environments. If no user selection is provided, it fallbacks to `docker` for all environments. It's worth to mention that the implementation to deal properly with user namespacing and permission handling on mountend volumns it's required to have at least `podman 4.x` installed. Earlier versions does not support the required handlinging and options. Minor moving of variable declaration are done as a drive-by change. The `docsGenerate` suite has been guard and display a concrete message when executed using the `podman` binary. Resolves: #1075 Related: #969
2023-12-18 23:41:14 +01:00
CONTAINER_BIN=""
COMPOSER_ROOT_VERSION="3.0.x-dev"
NODE_VERSION=22
HELP_TEXT_NPM_CI="Now running \'npm ci --silent\'."
HELP_TEXT_NPM_FAILURE="npm clean-install has failed. Please run \'${0} -s npm ci\' to explore."
[TASK] Add `-b` option to select container binary (#1076) TYPO3 core introduced the `-b` option for the `Build/Scripts/runTests.sh` script to provide the ability to select the container binary, `docker` or `podman` and enforces podman for CI (GitLab runner) runs after switching the Core CI infrastructure from Docker-In-Docker to Podman-In-Podman. The `ext:tea` adoption of the `runTests.sh` has been already adopted on a intermediate version and dropped the `docker-compose` based container definitions. Along with other minor prepration patches this allows now to add the container binary selection also. This change modifies `runTests.sh` to * add the `-b` option with a corresponding helptext addition and allows `podman` or `docker` - whereas the latter is the default. * integrates the determined and fixed issues with tty in CI environments by setting some paramater for the commands based on the CI detection (GitHub Action or GitLab Runner). Note: The implemention for `ext:tea` does not enforce hardcoed the `podman` binary for CI environments. If no user selection is provided, it fallbacks to `docker` for all environments. It's worth to mention that the implementation to deal properly with user namespacing and permission handling on mountend volumns it's required to have at least `podman 4.x` installed. Earlier versions does not support the required handlinging and options. Minor moving of variable declaration are done as a drive-by change. The `docsGenerate` suite has been guard and display a concrete message when executed using the `podman` binary. Resolves: #1075 Related: #969
2023-12-18 23:41:14 +01:00
CONTAINER_INTERACTIVE="-it --init"
HOST_UID=$(id -u)
HOST_PID=$(id -g)
USERSET=""
SUFFIX="$RANDOM"
[TASK] Add `-b` option to select container binary (#1076) TYPO3 core introduced the `-b` option for the `Build/Scripts/runTests.sh` script to provide the ability to select the container binary, `docker` or `podman` and enforces podman for CI (GitLab runner) runs after switching the Core CI infrastructure from Docker-In-Docker to Podman-In-Podman. The `ext:tea` adoption of the `runTests.sh` has been already adopted on a intermediate version and dropped the `docker-compose` based container definitions. Along with other minor prepration patches this allows now to add the container binary selection also. This change modifies `runTests.sh` to * add the `-b` option with a corresponding helptext addition and allows `podman` or `docker` - whereas the latter is the default. * integrates the determined and fixed issues with tty in CI environments by setting some paramater for the commands based on the CI detection (GitHub Action or GitLab Runner). Note: The implemention for `ext:tea` does not enforce hardcoed the `podman` binary for CI environments. If no user selection is provided, it fallbacks to `docker` for all environments. It's worth to mention that the implementation to deal properly with user namespacing and permission handling on mountend volumns it's required to have at least `podman 4.x` installed. Earlier versions does not support the required handlinging and options. Minor moving of variable declaration are done as a drive-by change. The `docsGenerate` suite has been guard and display a concrete message when executed using the `podman` binary. Resolves: #1075 Related: #969
2023-12-18 23:41:14 +01:00
NETWORK="friendsoftypo3-tea-${SUFFIX}"
CI_PARAMS="${CI_PARAMS:-}"
[TASK] Add `-b` option to select container binary (#1076) TYPO3 core introduced the `-b` option for the `Build/Scripts/runTests.sh` script to provide the ability to select the container binary, `docker` or `podman` and enforces podman for CI (GitLab runner) runs after switching the Core CI infrastructure from Docker-In-Docker to Podman-In-Podman. The `ext:tea` adoption of the `runTests.sh` has been already adopted on a intermediate version and dropped the `docker-compose` based container definitions. Along with other minor prepration patches this allows now to add the container binary selection also. This change modifies `runTests.sh` to * add the `-b` option with a corresponding helptext addition and allows `podman` or `docker` - whereas the latter is the default. * integrates the determined and fixed issues with tty in CI environments by setting some paramater for the commands based on the CI detection (GitHub Action or GitLab Runner). Note: The implemention for `ext:tea` does not enforce hardcoed the `podman` binary for CI environments. If no user selection is provided, it fallbacks to `docker` for all environments. It's worth to mention that the implementation to deal properly with user namespacing and permission handling on mountend volumns it's required to have at least `podman 4.x` installed. Earlier versions does not support the required handlinging and options. Minor moving of variable declaration are done as a drive-by change. The `docsGenerate` suite has been guard and display a concrete message when executed using the `podman` binary. Resolves: #1075 Related: #969
2023-12-18 23:41:14 +01:00
CONTAINER_HOST="host.docker.internal"
# shellcheck disable=SC2034 # This variable will be needed when we try to clean up the root folder
[TASK] Add `-b` option to select container binary (#1076) TYPO3 core introduced the `-b` option for the `Build/Scripts/runTests.sh` script to provide the ability to select the container binary, `docker` or `podman` and enforces podman for CI (GitLab runner) runs after switching the Core CI infrastructure from Docker-In-Docker to Podman-In-Podman. The `ext:tea` adoption of the `runTests.sh` has been already adopted on a intermediate version and dropped the `docker-compose` based container definitions. Along with other minor prepration patches this allows now to add the container binary selection also. This change modifies `runTests.sh` to * add the `-b` option with a corresponding helptext addition and allows `podman` or `docker` - whereas the latter is the default. * integrates the determined and fixed issues with tty in CI environments by setting some paramater for the commands based on the CI detection (GitHub Action or GitLab Runner). Note: The implemention for `ext:tea` does not enforce hardcoed the `podman` binary for CI environments. If no user selection is provided, it fallbacks to `docker` for all environments. It's worth to mention that the implementation to deal properly with user namespacing and permission handling on mountend volumns it's required to have at least `podman 4.x` installed. Earlier versions does not support the required handlinging and options. Minor moving of variable declaration are done as a drive-by change. The `docsGenerate` suite has been guard and display a concrete message when executed using the `podman` binary. Resolves: #1075 Related: #969
2023-12-18 23:41:14 +01:00
PHPSTAN_CONFIG_FILE="phpstan.neon"
IS_CORE_CI=0
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
# Option parsing updates above default vars
# Reset in case getopts has been used previously in the shell
OPTIND=1
# Array for invalid options
INVALID_OPTIONS=()
# Simple option parsing based on getopts (! not getopt)
[TASK] Add `-b` option to select container binary (#1076) TYPO3 core introduced the `-b` option for the `Build/Scripts/runTests.sh` script to provide the ability to select the container binary, `docker` or `podman` and enforces podman for CI (GitLab runner) runs after switching the Core CI infrastructure from Docker-In-Docker to Podman-In-Podman. The `ext:tea` adoption of the `runTests.sh` has been already adopted on a intermediate version and dropped the `docker-compose` based container definitions. Along with other minor prepration patches this allows now to add the container binary selection also. This change modifies `runTests.sh` to * add the `-b` option with a corresponding helptext addition and allows `podman` or `docker` - whereas the latter is the default. * integrates the determined and fixed issues with tty in CI environments by setting some paramater for the commands based on the CI detection (GitHub Action or GitLab Runner). Note: The implemention for `ext:tea` does not enforce hardcoed the `podman` binary for CI environments. If no user selection is provided, it fallbacks to `docker` for all environments. It's worth to mention that the implementation to deal properly with user namespacing and permission handling on mountend volumns it's required to have at least `podman 4.x` installed. Earlier versions does not support the required handlinging and options. Minor moving of variable declaration are done as a drive-by change. The `docsGenerate` suite has been guard and display a concrete message when executed using the `podman` binary. Resolves: #1075 Related: #969
2023-12-18 23:41:14 +01:00
while getopts "a:b:s:d:i:p:e:t:xy:o:nhu" OPT; do
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
case ${OPT} in
s)
TEST_SUITE=${OPTARG}
;;
a)
DATABASE_DRIVER=${OPTARG}
;;
[TASK] Add `-b` option to select container binary (#1076) TYPO3 core introduced the `-b` option for the `Build/Scripts/runTests.sh` script to provide the ability to select the container binary, `docker` or `podman` and enforces podman for CI (GitLab runner) runs after switching the Core CI infrastructure from Docker-In-Docker to Podman-In-Podman. The `ext:tea` adoption of the `runTests.sh` has been already adopted on a intermediate version and dropped the `docker-compose` based container definitions. Along with other minor prepration patches this allows now to add the container binary selection also. This change modifies `runTests.sh` to * add the `-b` option with a corresponding helptext addition and allows `podman` or `docker` - whereas the latter is the default. * integrates the determined and fixed issues with tty in CI environments by setting some paramater for the commands based on the CI detection (GitHub Action or GitLab Runner). Note: The implemention for `ext:tea` does not enforce hardcoed the `podman` binary for CI environments. If no user selection is provided, it fallbacks to `docker` for all environments. It's worth to mention that the implementation to deal properly with user namespacing and permission handling on mountend volumns it's required to have at least `podman 4.x` installed. Earlier versions does not support the required handlinging and options. Minor moving of variable declaration are done as a drive-by change. The `docsGenerate` suite has been guard and display a concrete message when executed using the `podman` binary. Resolves: #1075 Related: #969
2023-12-18 23:41:14 +01:00
b)
if ! [[ ${OPTARG} =~ ^(docker|podman)$ ]]; then
INVALID_OPTIONS+=("-b ${OPTARG}")
fi
CONTAINER_BIN=${OPTARG}
;;
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
d)
DBMS=${OPTARG}
;;
i)
DBMS_VERSION=${OPTARG}
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
;;
p)
PHP_VERSION=${OPTARG}
if ! [[ ${PHP_VERSION} =~ ^(7.4|8.0|8.1|8.2|8.3|8.4)$ ]]; then
[TASK] Add `-b` option to select container binary (#1076) TYPO3 core introduced the `-b` option for the `Build/Scripts/runTests.sh` script to provide the ability to select the container binary, `docker` or `podman` and enforces podman for CI (GitLab runner) runs after switching the Core CI infrastructure from Docker-In-Docker to Podman-In-Podman. The `ext:tea` adoption of the `runTests.sh` has been already adopted on a intermediate version and dropped the `docker-compose` based container definitions. Along with other minor prepration patches this allows now to add the container binary selection also. This change modifies `runTests.sh` to * add the `-b` option with a corresponding helptext addition and allows `podman` or `docker` - whereas the latter is the default. * integrates the determined and fixed issues with tty in CI environments by setting some paramater for the commands based on the CI detection (GitHub Action or GitLab Runner). Note: The implemention for `ext:tea` does not enforce hardcoed the `podman` binary for CI environments. If no user selection is provided, it fallbacks to `docker` for all environments. It's worth to mention that the implementation to deal properly with user namespacing and permission handling on mountend volumns it's required to have at least `podman 4.x` installed. Earlier versions does not support the required handlinging and options. Minor moving of variable declaration are done as a drive-by change. The `docsGenerate` suite has been guard and display a concrete message when executed using the `podman` binary. Resolves: #1075 Related: #969
2023-12-18 23:41:14 +01:00
INVALID_OPTIONS+=("-p ${OPTARG}")
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
fi
;;
e)
EXTRA_TEST_OPTIONS=${OPTARG}
;;
t)
CORE_VERSION=${OPTARG}
if ! [[ ${CORE_VERSION} =~ ^(11.5|12.4)$ ]]; then
[TASK] Add `-b` option to select container binary (#1076) TYPO3 core introduced the `-b` option for the `Build/Scripts/runTests.sh` script to provide the ability to select the container binary, `docker` or `podman` and enforces podman for CI (GitLab runner) runs after switching the Core CI infrastructure from Docker-In-Docker to Podman-In-Podman. The `ext:tea` adoption of the `runTests.sh` has been already adopted on a intermediate version and dropped the `docker-compose` based container definitions. Along with other minor prepration patches this allows now to add the container binary selection also. This change modifies `runTests.sh` to * add the `-b` option with a corresponding helptext addition and allows `podman` or `docker` - whereas the latter is the default. * integrates the determined and fixed issues with tty in CI environments by setting some paramater for the commands based on the CI detection (GitHub Action or GitLab Runner). Note: The implemention for `ext:tea` does not enforce hardcoed the `podman` binary for CI environments. If no user selection is provided, it fallbacks to `docker` for all environments. It's worth to mention that the implementation to deal properly with user namespacing and permission handling on mountend volumns it's required to have at least `podman 4.x` installed. Earlier versions does not support the required handlinging and options. Minor moving of variable declaration are done as a drive-by change. The `docsGenerate` suite has been guard and display a concrete message when executed using the `podman` binary. Resolves: #1075 Related: #969
2023-12-18 23:41:14 +01:00
INVALID_OPTIONS+=("-t ${OPTARG}")
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
fi
;;
x)
PHP_XDEBUG_ON=1
;;
y)
PHP_XDEBUG_PORT=${OPTARG}
;;
o)
PHPUNIT_RANDOM="--random-order-seed=${OPTARG}"
;;
n)
CGLCHECK_DRY_RUN=1
;;
h)
loadHelp
echo "${HELP}"
exit 0
;;
u)
TEST_SUITE=update
;;
\?)
[TASK] Add `-b` option to select container binary (#1076) TYPO3 core introduced the `-b` option for the `Build/Scripts/runTests.sh` script to provide the ability to select the container binary, `docker` or `podman` and enforces podman for CI (GitLab runner) runs after switching the Core CI infrastructure from Docker-In-Docker to Podman-In-Podman. The `ext:tea` adoption of the `runTests.sh` has been already adopted on a intermediate version and dropped the `docker-compose` based container definitions. Along with other minor prepration patches this allows now to add the container binary selection also. This change modifies `runTests.sh` to * add the `-b` option with a corresponding helptext addition and allows `podman` or `docker` - whereas the latter is the default. * integrates the determined and fixed issues with tty in CI environments by setting some paramater for the commands based on the CI detection (GitHub Action or GitLab Runner). Note: The implemention for `ext:tea` does not enforce hardcoed the `podman` binary for CI environments. If no user selection is provided, it fallbacks to `docker` for all environments. It's worth to mention that the implementation to deal properly with user namespacing and permission handling on mountend volumns it's required to have at least `podman 4.x` installed. Earlier versions does not support the required handlinging and options. Minor moving of variable declaration are done as a drive-by change. The `docsGenerate` suite has been guard and display a concrete message when executed using the `podman` binary. Resolves: #1075 Related: #969
2023-12-18 23:41:14 +01:00
INVALID_OPTIONS+=("-${OPTARG}")
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
;;
:)
[TASK] Add `-b` option to select container binary (#1076) TYPO3 core introduced the `-b` option for the `Build/Scripts/runTests.sh` script to provide the ability to select the container binary, `docker` or `podman` and enforces podman for CI (GitLab runner) runs after switching the Core CI infrastructure from Docker-In-Docker to Podman-In-Podman. The `ext:tea` adoption of the `runTests.sh` has been already adopted on a intermediate version and dropped the `docker-compose` based container definitions. Along with other minor prepration patches this allows now to add the container binary selection also. This change modifies `runTests.sh` to * add the `-b` option with a corresponding helptext addition and allows `podman` or `docker` - whereas the latter is the default. * integrates the determined and fixed issues with tty in CI environments by setting some paramater for the commands based on the CI detection (GitHub Action or GitLab Runner). Note: The implemention for `ext:tea` does not enforce hardcoed the `podman` binary for CI environments. If no user selection is provided, it fallbacks to `docker` for all environments. It's worth to mention that the implementation to deal properly with user namespacing and permission handling on mountend volumns it's required to have at least `podman 4.x` installed. Earlier versions does not support the required handlinging and options. Minor moving of variable declaration are done as a drive-by change. The `docsGenerate` suite has been guard and display a concrete message when executed using the `podman` binary. Resolves: #1075 Related: #969
2023-12-18 23:41:14 +01:00
INVALID_OPTIONS+=("-${OPTARG}")
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
;;
esac
done
# Exit on invalid options
if [ ${#INVALID_OPTIONS[@]} -ne 0 ]; then
echo "Invalid option(s):" >&2
for I in "${INVALID_OPTIONS[@]}"; do
[TASK] Add `-b` option to select container binary (#1076) TYPO3 core introduced the `-b` option for the `Build/Scripts/runTests.sh` script to provide the ability to select the container binary, `docker` or `podman` and enforces podman for CI (GitLab runner) runs after switching the Core CI infrastructure from Docker-In-Docker to Podman-In-Podman. The `ext:tea` adoption of the `runTests.sh` has been already adopted on a intermediate version and dropped the `docker-compose` based container definitions. Along with other minor prepration patches this allows now to add the container binary selection also. This change modifies `runTests.sh` to * add the `-b` option with a corresponding helptext addition and allows `podman` or `docker` - whereas the latter is the default. * integrates the determined and fixed issues with tty in CI environments by setting some paramater for the commands based on the CI detection (GitHub Action or GitLab Runner). Note: The implemention for `ext:tea` does not enforce hardcoed the `podman` binary for CI environments. If no user selection is provided, it fallbacks to `docker` for all environments. It's worth to mention that the implementation to deal properly with user namespacing and permission handling on mountend volumns it's required to have at least `podman 4.x` installed. Earlier versions does not support the required handlinging and options. Minor moving of variable declaration are done as a drive-by change. The `docsGenerate` suite has been guard and display a concrete message when executed using the `podman` binary. Resolves: #1075 Related: #969
2023-12-18 23:41:14 +01:00
echo ${I} >&2
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
done
echo >&2
echo "call \".Build/Scripts/runTests.sh -h\" to display help and valid options"
exit 1
fi
[TASK] Add `-b` option to select container binary (#1076) TYPO3 core introduced the `-b` option for the `Build/Scripts/runTests.sh` script to provide the ability to select the container binary, `docker` or `podman` and enforces podman for CI (GitLab runner) runs after switching the Core CI infrastructure from Docker-In-Docker to Podman-In-Podman. The `ext:tea` adoption of the `runTests.sh` has been already adopted on a intermediate version and dropped the `docker-compose` based container definitions. Along with other minor prepration patches this allows now to add the container binary selection also. This change modifies `runTests.sh` to * add the `-b` option with a corresponding helptext addition and allows `podman` or `docker` - whereas the latter is the default. * integrates the determined and fixed issues with tty in CI environments by setting some paramater for the commands based on the CI detection (GitHub Action or GitLab Runner). Note: The implemention for `ext:tea` does not enforce hardcoed the `podman` binary for CI environments. If no user selection is provided, it fallbacks to `docker` for all environments. It's worth to mention that the implementation to deal properly with user namespacing and permission handling on mountend volumns it's required to have at least `podman 4.x` installed. Earlier versions does not support the required handlinging and options. Minor moving of variable declaration are done as a drive-by change. The `docsGenerate` suite has been guard and display a concrete message when executed using the `podman` binary. Resolves: #1075 Related: #969
2023-12-18 23:41:14 +01:00
handleDbmsOptions
# ENV var "CI" is set by gitlab-ci. Use it to force some CI details.
if [ "${CI}" == "true" ]; then
IS_CORE_CI=1
CONTAINER_INTERACTIVE=""
fi
# determine default container binary to use: 1. podman 2. docker
if [[ -z "${CONTAINER_BIN}" ]]; then
if type "podman" >/dev/null 2>&1; then
CONTAINER_BIN="podman"
elif type "docker" >/dev/null 2>&1; then
CONTAINER_BIN="docker"
fi
[TASK] Add `-b` option to select container binary (#1076) TYPO3 core introduced the `-b` option for the `Build/Scripts/runTests.sh` script to provide the ability to select the container binary, `docker` or `podman` and enforces podman for CI (GitLab runner) runs after switching the Core CI infrastructure from Docker-In-Docker to Podman-In-Podman. The `ext:tea` adoption of the `runTests.sh` has been already adopted on a intermediate version and dropped the `docker-compose` based container definitions. Along with other minor prepration patches this allows now to add the container binary selection also. This change modifies `runTests.sh` to * add the `-b` option with a corresponding helptext addition and allows `podman` or `docker` - whereas the latter is the default. * integrates the determined and fixed issues with tty in CI environments by setting some paramater for the commands based on the CI detection (GitHub Action or GitLab Runner). Note: The implemention for `ext:tea` does not enforce hardcoed the `podman` binary for CI environments. If no user selection is provided, it fallbacks to `docker` for all environments. It's worth to mention that the implementation to deal properly with user namespacing and permission handling on mountend volumns it's required to have at least `podman 4.x` installed. Earlier versions does not support the required handlinging and options. Minor moving of variable declaration are done as a drive-by change. The `docsGenerate` suite has been guard and display a concrete message when executed using the `podman` binary. Resolves: #1075 Related: #969
2023-12-18 23:41:14 +01:00
fi
if [ "$(uname)" != "Darwin" ] && [ "${CONTAINER_BIN}" == "docker" ]; then
[TASK] Add `-b` option to select container binary (#1076) TYPO3 core introduced the `-b` option for the `Build/Scripts/runTests.sh` script to provide the ability to select the container binary, `docker` or `podman` and enforces podman for CI (GitLab runner) runs after switching the Core CI infrastructure from Docker-In-Docker to Podman-In-Podman. The `ext:tea` adoption of the `runTests.sh` has been already adopted on a intermediate version and dropped the `docker-compose` based container definitions. Along with other minor prepration patches this allows now to add the container binary selection also. This change modifies `runTests.sh` to * add the `-b` option with a corresponding helptext addition and allows `podman` or `docker` - whereas the latter is the default. * integrates the determined and fixed issues with tty in CI environments by setting some paramater for the commands based on the CI detection (GitHub Action or GitLab Runner). Note: The implemention for `ext:tea` does not enforce hardcoed the `podman` binary for CI environments. If no user selection is provided, it fallbacks to `docker` for all environments. It's worth to mention that the implementation to deal properly with user namespacing and permission handling on mountend volumns it's required to have at least `podman 4.x` installed. Earlier versions does not support the required handlinging and options. Minor moving of variable declaration are done as a drive-by change. The `docsGenerate` suite has been guard and display a concrete message when executed using the `podman` binary. Resolves: #1075 Related: #969
2023-12-18 23:41:14 +01:00
# Run docker jobs as current user to prevent permission issues. Not needed with podman.
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
USERSET="--user $HOST_UID"
fi
[TASK] Add `-b` option to select container binary (#1076) TYPO3 core introduced the `-b` option for the `Build/Scripts/runTests.sh` script to provide the ability to select the container binary, `docker` or `podman` and enforces podman for CI (GitLab runner) runs after switching the Core CI infrastructure from Docker-In-Docker to Podman-In-Podman. The `ext:tea` adoption of the `runTests.sh` has been already adopted on a intermediate version and dropped the `docker-compose` based container definitions. Along with other minor prepration patches this allows now to add the container binary selection also. This change modifies `runTests.sh` to * add the `-b` option with a corresponding helptext addition and allows `podman` or `docker` - whereas the latter is the default. * integrates the determined and fixed issues with tty in CI environments by setting some paramater for the commands based on the CI detection (GitHub Action or GitLab Runner). Note: The implemention for `ext:tea` does not enforce hardcoed the `podman` binary for CI environments. If no user selection is provided, it fallbacks to `docker` for all environments. It's worth to mention that the implementation to deal properly with user namespacing and permission handling on mountend volumns it's required to have at least `podman 4.x` installed. Earlier versions does not support the required handlinging and options. Minor moving of variable declaration are done as a drive-by change. The `docsGenerate` suite has been guard and display a concrete message when executed using the `podman` binary. Resolves: #1075 Related: #969
2023-12-18 23:41:14 +01:00
if ! type ${CONTAINER_BIN} >/dev/null 2>&1; then
echo "Selected container environment \"${CONTAINER_BIN}\" not found. Please install \"${CONTAINER_BIN}\" or use -b option to select one." >&2
exit 1
fi
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
# Create .cache dir: composer need this.
mkdir -p .cache
mkdir -p .Build/public/typo3temp/var/tests
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
IMAGE_PHP="ghcr.io/typo3/core-testing-$(echo "php${PHP_VERSION}" | sed -e 's/\.//'):latest"
IMAGE_NODE="docker.io/node:${NODE_VERSION}-alpine"
IMAGE_ALPINE="docker.io/alpine:3.8"
IMAGE_SHELLCHECK="docker.io/koalaman/shellcheck:v0.10.0"
IMAGE_DOCS="ghcr.io/typo3-documentation/render-guides:latest"
IMAGE_MARIADB="docker.io/mariadb:${DBMS_VERSION}"
IMAGE_MYSQL="docker.io/mysql:${DBMS_VERSION}"
IMAGE_POSTGRES="docker.io/postgres:${DBMS_VERSION}-alpine"
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
# Set $1 to first mass argument, this is the optional test file or test directory to execute
shift $((OPTIND - 1))
TEST_FILE=${1}
${CONTAINER_BIN} network create ${NETWORK} >/dev/null
[TASK] Add `-b` option to select container binary (#1076) TYPO3 core introduced the `-b` option for the `Build/Scripts/runTests.sh` script to provide the ability to select the container binary, `docker` or `podman` and enforces podman for CI (GitLab runner) runs after switching the Core CI infrastructure from Docker-In-Docker to Podman-In-Podman. The `ext:tea` adoption of the `runTests.sh` has been already adopted on a intermediate version and dropped the `docker-compose` based container definitions. Along with other minor prepration patches this allows now to add the container binary selection also. This change modifies `runTests.sh` to * add the `-b` option with a corresponding helptext addition and allows `podman` or `docker` - whereas the latter is the default. * integrates the determined and fixed issues with tty in CI environments by setting some paramater for the commands based on the CI detection (GitHub Action or GitLab Runner). Note: The implemention for `ext:tea` does not enforce hardcoed the `podman` binary for CI environments. If no user selection is provided, it fallbacks to `docker` for all environments. It's worth to mention that the implementation to deal properly with user namespacing and permission handling on mountend volumns it's required to have at least `podman 4.x` installed. Earlier versions does not support the required handlinging and options. Minor moving of variable declaration are done as a drive-by change. The `docsGenerate` suite has been guard and display a concrete message when executed using the `podman` binary. Resolves: #1075 Related: #969
2023-12-18 23:41:14 +01:00
if [ "${CONTAINER_BIN}" == "docker" ]; then
CONTAINER_COMMON_PARAMS="${CONTAINER_INTERACTIVE} --rm --network ${NETWORK} --add-host "${CONTAINER_HOST}:host-gateway" ${USERSET} -v ${ROOT_DIR}:${ROOT_DIR} -w ${ROOT_DIR}"
else
# podman
CONTAINER_HOST="host.containers.internal"
CONTAINER_COMMON_PARAMS="${CONTAINER_INTERACTIVE} ${CI_PARAMS} --rm --network ${NETWORK} -v ${ROOT_DIR}:${ROOT_DIR} -w ${ROOT_DIR}"
fi
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
if [ ${PHP_XDEBUG_ON} -eq 0 ]; then
XDEBUG_MODE="-e XDEBUG_MODE=off"
XDEBUG_CONFIG=" "
else
XDEBUG_MODE="-e XDEBUG_MODE=debug -e XDEBUG_TRIGGER=foo"
XDEBUG_CONFIG="client_port=${PHP_XDEBUG_PORT} client_host=host.docker.internal"
fi
# Suite execution
case ${TEST_SUITE} in
cgl)
if [ "${CGLCHECK_DRY_RUN}" -eq 1 ]; then
COMMAND="composer ci:php:cs-fixer"
else
COMMAND="composer fix:php:cs"
fi
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-command-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/sh -c "${COMMAND}"
SUITE_EXIT_CODE=$?
;;
clean)
cleanCacheFiles
cleanRenderedDocumentationFiles
cleanTestFiles
;;
cleanCache)
cleanCacheFiles
;;
cleanRenderedDocumentation)
cleanRenderedDocumentationFiles
;;
cleanTests)
cleanTestFiles
;;
composer)
COMMAND_PARTS=(composer "$@")
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-command-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} "${COMMAND_PARTS[@]}"
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
SUITE_EXIT_CODE=$?
;;
composerUpdateMax)
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
COMMAND="composer config --unset platform.php; composer require --no-ansi --no-interaction --no-progress --no-install typo3/cms-core:"^${CORE_VERSION}"; composer update --no-progress --no-interaction; composer dumpautoload; composer show"
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-install-max-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/sh -c "${COMMAND}"
SUITE_EXIT_CODE=$?
;;
composerUpdateMin)
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
COMMAND="composer config platform.php ${PHP_VERSION}.0; composer require --no-ansi --no-interaction --no-progress --no-install typo3/cms-core:"^${CORE_VERSION}"; composer update --prefer-lowest --no-progress --no-interaction; composer dumpautoload; composer show"
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-install-min-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/sh -c "${COMMAND}"
SUITE_EXIT_CODE=$?
;;
composerNormalize)
COMMAND="composer ci:composer:normalize"
if [ "${CGLCHECK_DRY_RUN}" -eq 1 ]; then
COMMAND="composer ci:composer:normalize"
else
COMMAND="composer fix:composer:normalize"
fi
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-normalize-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_DOCS} /bin/sh -c "${COMMAND}"
SUITE_EXIT_CODE=$?
;;
composerUnused)
COMMAND="composer ci:composer:unused"
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-unused-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/sh -c "${COMMAND}"
SUITE_EXIT_CODE=$?
;;
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
docsGenerate)
mkdir -p Documentation-GENERATED-temp
chown -R ${HOST_UID}:${HOST_PID} Documentation-GENERATED-temp
${CONTAINER_BIN} run ${CONTAINER_INTERACTIVE} --rm --pull always ${USERSET} -v "${ROOT_DIR}":/project ${IMAGE_DOCS} --config=Documentation --fail-on-log
SUITE_EXIT_CODE=$?
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
;;
shellcheck)
${CONTAINER_BIN} run ${CONTAINER_INTERACTIVE} --rm --pull always ${USERSET} -v "${ROOT_DIR}":/project:ro -e SHELLCHECK_OPTS="-e SC2086" ${IMAGE_SHELLCHECK} /project/Build/Scripts/runTests.sh
SUITE_EXIT_CODE=$?
;;
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
functional)
[ -z "${TEST_FILE}" ] && TEST_FILE="Tests/Functional"
COMMAND=".Build/bin/phpunit -c Build/phpunit/FunctionalTests.xml --exclude-group not-${DBMS} ${EXTRA_TEST_OPTIONS} ${TEST_FILE}"
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
case ${DBMS} in
mariadb)
echo "Using driver: ${DATABASE_DRIVER}"
[TASK] Add `-b` option to select container binary (#1076) TYPO3 core introduced the `-b` option for the `Build/Scripts/runTests.sh` script to provide the ability to select the container binary, `docker` or `podman` and enforces podman for CI (GitLab runner) runs after switching the Core CI infrastructure from Docker-In-Docker to Podman-In-Podman. The `ext:tea` adoption of the `runTests.sh` has been already adopted on a intermediate version and dropped the `docker-compose` based container definitions. Along with other minor prepration patches this allows now to add the container binary selection also. This change modifies `runTests.sh` to * add the `-b` option with a corresponding helptext addition and allows `podman` or `docker` - whereas the latter is the default. * integrates the determined and fixed issues with tty in CI environments by setting some paramater for the commands based on the CI detection (GitHub Action or GitLab Runner). Note: The implemention for `ext:tea` does not enforce hardcoed the `podman` binary for CI environments. If no user selection is provided, it fallbacks to `docker` for all environments. It's worth to mention that the implementation to deal properly with user namespacing and permission handling on mountend volumns it's required to have at least `podman 4.x` installed. Earlier versions does not support the required handlinging and options. Minor moving of variable declaration are done as a drive-by change. The `docsGenerate` suite has been guard and display a concrete message when executed using the `podman` binary. Resolves: #1075 Related: #969
2023-12-18 23:41:14 +01:00
${CONTAINER_BIN} run --rm ${CI_PARAMS} --name mariadb-func-${SUFFIX} --network ${NETWORK} -d -e MYSQL_ROOT_PASSWORD=funcp --tmpfs /var/lib/mysql/:rw,noexec,nosuid ${IMAGE_MARIADB} >/dev/null
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
waitFor mariadb-func-${SUFFIX} 3306
CONTAINERPARAMS="-e typo3DatabaseDriver=${DATABASE_DRIVER} -e typo3DatabaseName=func_test -e typo3DatabaseUsername=root -e typo3DatabaseHost=mariadb-func-${SUFFIX} -e typo3DatabasePassword=funcp"
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name functional-${SUFFIX} ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${CONTAINERPARAMS} ${IMAGE_PHP} ${COMMAND}
SUITE_EXIT_CODE=$?
;;
mysql)
echo "Using driver: ${DATABASE_DRIVER}"
[TASK] Add `-b` option to select container binary (#1076) TYPO3 core introduced the `-b` option for the `Build/Scripts/runTests.sh` script to provide the ability to select the container binary, `docker` or `podman` and enforces podman for CI (GitLab runner) runs after switching the Core CI infrastructure from Docker-In-Docker to Podman-In-Podman. The `ext:tea` adoption of the `runTests.sh` has been already adopted on a intermediate version and dropped the `docker-compose` based container definitions. Along with other minor prepration patches this allows now to add the container binary selection also. This change modifies `runTests.sh` to * add the `-b` option with a corresponding helptext addition and allows `podman` or `docker` - whereas the latter is the default. * integrates the determined and fixed issues with tty in CI environments by setting some paramater for the commands based on the CI detection (GitHub Action or GitLab Runner). Note: The implemention for `ext:tea` does not enforce hardcoed the `podman` binary for CI environments. If no user selection is provided, it fallbacks to `docker` for all environments. It's worth to mention that the implementation to deal properly with user namespacing and permission handling on mountend volumns it's required to have at least `podman 4.x` installed. Earlier versions does not support the required handlinging and options. Minor moving of variable declaration are done as a drive-by change. The `docsGenerate` suite has been guard and display a concrete message when executed using the `podman` binary. Resolves: #1075 Related: #969
2023-12-18 23:41:14 +01:00
${CONTAINER_BIN} run --rm ${CI_PARAMS} --name mysql-func-${SUFFIX} --network ${NETWORK} -d -e MYSQL_ROOT_PASSWORD=funcp --tmpfs /var/lib/mysql/:rw,noexec,nosuid ${IMAGE_MYSQL} >/dev/null
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
waitFor mysql-func-${SUFFIX} 3306
CONTAINERPARAMS="-e typo3DatabaseDriver=${DATABASE_DRIVER} -e typo3DatabaseName=func_test -e typo3DatabaseUsername=root -e typo3DatabaseHost=mysql-func-${SUFFIX} -e typo3DatabasePassword=funcp"
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name functional-${SUFFIX} ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${CONTAINERPARAMS} ${IMAGE_PHP} ${COMMAND}
SUITE_EXIT_CODE=$?
;;
postgres)
[TASK] Add `-b` option to select container binary (#1076) TYPO3 core introduced the `-b` option for the `Build/Scripts/runTests.sh` script to provide the ability to select the container binary, `docker` or `podman` and enforces podman for CI (GitLab runner) runs after switching the Core CI infrastructure from Docker-In-Docker to Podman-In-Podman. The `ext:tea` adoption of the `runTests.sh` has been already adopted on a intermediate version and dropped the `docker-compose` based container definitions. Along with other minor prepration patches this allows now to add the container binary selection also. This change modifies `runTests.sh` to * add the `-b` option with a corresponding helptext addition and allows `podman` or `docker` - whereas the latter is the default. * integrates the determined and fixed issues with tty in CI environments by setting some paramater for the commands based on the CI detection (GitHub Action or GitLab Runner). Note: The implemention for `ext:tea` does not enforce hardcoed the `podman` binary for CI environments. If no user selection is provided, it fallbacks to `docker` for all environments. It's worth to mention that the implementation to deal properly with user namespacing and permission handling on mountend volumns it's required to have at least `podman 4.x` installed. Earlier versions does not support the required handlinging and options. Minor moving of variable declaration are done as a drive-by change. The `docsGenerate` suite has been guard and display a concrete message when executed using the `podman` binary. Resolves: #1075 Related: #969
2023-12-18 23:41:14 +01:00
${CONTAINER_BIN} run --rm ${CI_PARAMS} --name postgres-func-${SUFFIX} --network ${NETWORK} -d -e POSTGRES_PASSWORD=funcp -e POSTGRES_USER=funcu --tmpfs /var/lib/postgresql/data:rw,noexec,nosuid ${IMAGE_POSTGRES} >/dev/null
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
waitFor postgres-func-${SUFFIX} 5432
CONTAINERPARAMS="-e typo3DatabaseDriver=pdo_pgsql -e typo3DatabaseName=bamboo -e typo3DatabaseUsername=funcu -e typo3DatabaseHost=postgres-func-${SUFFIX} -e typo3DatabasePassword=funcp"
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name functional-${SUFFIX} ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${CONTAINERPARAMS} ${IMAGE_PHP} ${COMMAND}
SUITE_EXIT_CODE=$?
;;
sqlite)
CONTAINERPARAMS="-e typo3DatabaseDriver=pdo_sqlite"
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name functional-${SUFFIX} ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${CONTAINERPARAMS} ${IMAGE_PHP} ${COMMAND}
SUITE_EXIT_CODE=$?
;;
esac
;;
lintTypoScript)
COMMAND="composer ci:typoscript:lint"
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-command-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/sh -c "${COMMAND}"
SUITE_EXIT_CODE=$?
;;
lintPhp)
COMMAND="composer ci:php:lint"
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-command-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/sh -c "${COMMAND}"
SUITE_EXIT_CODE=$?
;;
lintJs)
if [ "${CGLCHECK_DRY_RUN}" -eq 1 ]; then
COMMAND="echo ${HELP_TEXT_NPM_CI}; npm ci --silent || { echo ${HELP_TEXT_NPM_FAILURE}; exit 1; } && npm run ci:lint:js"
else
COMMAND="echo ${HELP_TEXT_NPM_CI}; npm ci --silent || { echo ${HELP_TEXT_NPM_FAILURE}; exit 1; } && npm run fix:lint:js"
fi
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name npm-command-${SUFFIX} ${IMAGE_NODE} /bin/sh -c "${COMMAND}"
SUITE_EXIT_CODE=$?
;;
lintCss)
if [ "${CGLCHECK_DRY_RUN}" -eq 1 ]; then
COMMAND="echo ${HELP_TEXT_NPM_CI}; npm ci --silent || { echo ${HELP_TEXT_NPM_FAILURE}; exit 1; } && npm run ci:lint:css"
else
COMMAND="echo ${HELP_TEXT_NPM_CI}; npm ci --silent || { echo ${HELP_TEXT_NPM_FAILURE}; exit 1; } && npm run fix:lint:css"
fi
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name npm-command-${SUFFIX} ${IMAGE_NODE} /bin/sh -c "${COMMAND}"
SUITE_EXIT_CODE=$?
;;
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
lintJson)
COMMAND="composer ci:json:lint"
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-command-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/sh -c "${COMMAND}"
SUITE_EXIT_CODE=$?
;;
lintYaml)
COMMAND="composer ci:yaml:lint"
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-command-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/sh -c "${COMMAND}"
SUITE_EXIT_CODE=$?
;;
npm)
COMMAND_PARTS=(npm "$@")
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name npm-command-${SUFFIX} ${IMAGE_NODE} "${COMMAND_PARTS[@]}"
SUITE_EXIT_CODE=$?
;;
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
phpstan)
COMMAND="composer ci:php:stan"
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-command-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/sh -c "${COMMAND}"
SUITE_EXIT_CODE=$?
;;
phpstanGenerateBaseline)
COMMAND="composer phpstan:baseline"
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-command-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} /bin/sh -c "${COMMAND}"
SUITE_EXIT_CODE=$?
;;
unit)
[ -z "${TEST_FILE}" ] && TEST_FILE="Tests/Unit"
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name unit-${SUFFIX} ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${IMAGE_PHP} .Build/bin/phpunit -c Build/phpunit/UnitTests.xml ${EXTRA_TEST_OPTIONS} ${TEST_FILE}
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
SUITE_EXIT_CODE=$?
;;
unitRandom)
[ -z "${TEST_FILE}" ] && TEST_FILE="Tests/Unit"
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name unit-random-${SUFFIX} ${XDEBUG_MODE} -e XDEBUG_CONFIG="${XDEBUG_CONFIG}" ${IMAGE_PHP} .Build/bin/phpunit -c Build/phpunit/UnitTests.xml --order-by=random ${EXTRA_TEST_OPTIONS} ${PHPUNIT_RANDOM} ${TEST_FILE}
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
SUITE_EXIT_CODE=$?
;;
update)
# pull typo3/core-testing-*:latest versions of those ones that exist locally
echo "> pull ghcr.io/typo3/core-testing-*:latest versions of those ones that exist locally"
${CONTAINER_BIN} images ghcr.io/typo3/core-testing-*:latest --format "{{.Repository}}:latest" | xargs -I {} ${CONTAINER_BIN} pull {}
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
echo ""
# remove "dangling" typo3/core-testing-* images (those tagged as <none>)
echo "> remove \"dangling\" ghcr.io/typo3/core-testing-* images (those tagged as <none>)"
${CONTAINER_BIN} images --filter "reference=ghcr.io/typo3/core-testing-*" --filter "dangling=true" --format "{{.ID}}" | xargs -I {} ${CONTAINER_BIN} rmi {}
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
echo ""
;;
*)
loadHelp
echo "Invalid -s option argument ${TEST_SUITE}" >&2
echo >&2
echo "${HELP}" >&2
if [ ${CONTAINER_BIN} = "docker" ]; then
${CONTAINER_BIN} network rm ${NETWORK} >/dev/null
else
${CONTAINER_BIN} network rm -f ${NETWORK} >/dev/null
fi
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
exit 1
;;
esac
cleanUp
# Print summary
echo "" >&2
echo "###########################################################################" >&2
echo "Result of ${TEST_SUITE}" >&2
if [[ ${IS_CORE_CI} -eq 1 ]]; then
echo "Environment: CI" >&2
else
echo "Environment: local" >&2
fi
if [[ ${TEST_SUITE} =~ ^(npm|lintCss|lintJs)$ ]]; then
echo "NODE: ${NODE_VERSION}" >&2
else
echo "PHP: ${PHP_VERSION}" >&2
echo "TYPO3: ${CORE_VERSION}" >&2
fi
[TASK] Add `-b` option to select container binary (#1076) TYPO3 core introduced the `-b` option for the `Build/Scripts/runTests.sh` script to provide the ability to select the container binary, `docker` or `podman` and enforces podman for CI (GitLab runner) runs after switching the Core CI infrastructure from Docker-In-Docker to Podman-In-Podman. The `ext:tea` adoption of the `runTests.sh` has been already adopted on a intermediate version and dropped the `docker-compose` based container definitions. Along with other minor prepration patches this allows now to add the container binary selection also. This change modifies `runTests.sh` to * add the `-b` option with a corresponding helptext addition and allows `podman` or `docker` - whereas the latter is the default. * integrates the determined and fixed issues with tty in CI environments by setting some paramater for the commands based on the CI detection (GitHub Action or GitLab Runner). Note: The implemention for `ext:tea` does not enforce hardcoed the `podman` binary for CI environments. If no user selection is provided, it fallbacks to `docker` for all environments. It's worth to mention that the implementation to deal properly with user namespacing and permission handling on mountend volumns it's required to have at least `podman 4.x` installed. Earlier versions does not support the required handlinging and options. Minor moving of variable declaration are done as a drive-by change. The `docsGenerate` suite has been guard and display a concrete message when executed using the `podman` binary. Resolves: #1075 Related: #969
2023-12-18 23:41:14 +01:00
echo "CONTAINER_BIN: ${CONTAINER_BIN}"
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
if [[ ${TEST_SUITE} =~ ^functional$ ]]; then
case "${DBMS}" in
mariadb|mysql)
echo "DBMS: ${DBMS} version ${DBMS_VERSION} driver ${DATABASE_DRIVER}" >&2
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
;;
postgres)
echo "DBMS: ${DBMS} version ${DBMS_VERSION} driver pdo_pgsql" >&2
;;
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
sqlite)
echo "DBMS: ${DBMS} driver pdo_sqlite" >&2
[FEATURE] Integrate `runTests.sh` execution wrapper - round one (#900) TYPO3 Core and related repositories like the `typo3/testing-framework` or `typo3/styleguide` uses a bash script arround docker to execute all scripts over different operating systems in a controlled and ensured manner. This helps to reproduce locally failing jobs from a CI like GitHub actions or GitLab. TYPO3 core dropped recently the requirement for `docker-compose`, reducing it to `docker` and preparing for dual usage with docker and podman in the future. This change integrates the current state as extension wrapper, aligning contained suits with existing tools. Additionally, a TYPO3 core version switch is integrated. The added script is excluded from git archive building and during releasing. A list of possible options can be display with: ```shell Build/Scripts/runTests.sh -h ``` Overview of integrated features: * `-p` to select the PHP version (7.4 - 8.3) * `-s` to select the suite to execute * `-t` to select the TYPO3 core version, mainly needed for the `composer` suits executions * `-e` to provide additionally flags for phpunit executions, e.g. for unit and functional tests * `-x` to enable xdebug trigger - this helps with debugging during unit or functional test * `-d` to select the database backend to use, needed for functional test execution to start the correct database * `-a` to select the used php driver for the `-d` database backend, if multiple options are possible * `-i` to specify the mariadb version * `-j` to specify the mysql version * `-k` to specify the postgres version Available suits (`-s`): - cgl: Checks the code style with the PHP Coding Standards Fixer (PHP-CS-Fixer). - cglFix: Fixes the code style with PHP-CS-Fixer." - clean: clean up build, cache and testing related files and folders - cleanBuild: clean up build related files and folders - cleanCache: clean up cache related files and folders - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp) - cleanTests: clean up test related files and folders - composer: "composer" with all remaining arguments dispatched. - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - docsGenerate: Renders the extension ReST documentation. - functional: PHP functional tests - lintTypoScript: TypoScript linting - lintPhp: PHP linting - lintJson: JSON linting - lintYaml: YAML linting - phpstan: phpstan tests - phpstanGenerateBaseline: regenerate phpstan baseline, handy after phpstan updates - unit (default): PHP unit tests - unitRandom: PHP unit tests in random order, add -o <number> to use specific seed Notes: * Not everything is available directly for now in the `runTests.sh` and therefore not enabled in CI. * Coverage related execution needs extended work and are therefore left out for now. * `composer.json` protection for core version changes not included yet like the one or other advanced option. * Intermediate cleanings for changing php versions and core versions not included yet and will follow. * typo3/testing-framework template files **must** be copied to the extension or project and **must not** be used from the vendor folder. Resolves: #899 Releases: main
2023-07-31 13:38:07 +02:00
;;
esac
fi
if [[ ${SUITE_EXIT_CODE} -eq 0 ]]; then
echo "SUCCESS" >&2
else
echo "FAILURE" >&2
fi
echo "###########################################################################" >&2
echo "" >&2
# Exit with code of test suite - This script return non-zero if the executed test failed.
exit $SUITE_EXIT_CODE