Commit 17443f7a authored by Andreas Fernandez's avatar Andreas Fernandez
Browse files

[TASK] Rename runTests.sh suites and optimize php linting

To be more consistent:
* Rename "-s install" to "-s acceptanceInstall"
* Rename "-s cglAll" to "-s cgl"
* Rename "-s lint" to "-s lintPhp"

Apart from that, the cgl checker also lints the files
before checking cgl. The explicit pre-merge lint jobs
are thus obsolete in pre-merge.
We keep "lint everything" for nightlies to be sure.

Resolves: #94769
Releases: master
Change-Id: Ie7b409f3b2485a8792199e4ad2eaec8565daf253
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/70340


Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
parent cd4ce0a0
......@@ -89,10 +89,11 @@ Options:
-s <...>
Specifies which test suite to run
- acceptance: main backend acceptance tests
- acceptanceInstall: installation acceptance tests, only with -d mariadb|postgres|sqlite
- buildCss: execute scss to css builder
- buildJavascript: execute typescript to javascript builder
- cgl: test and fix all core php files
- cglGit: test and fix latest committed patch for CGL compliance
- cglAll: test and fix all core php files
- checkAnnotations: check php code for allowed annotations
- checkBom: check UTF-8 files do not contain BOM
- checkComposer: check composer.json files for version integrity
......@@ -110,8 +111,7 @@ Options:
- composerValidate: "composer validate"
- fixCsvFixtures: fix broken functional test csv fixtures
- functional: functional tests
- install: installation acceptance tests, only with -d mariadb|postgres|sqlite
- lint: PHP linting
- lintPhp: PHP linting
- lintScss: SCSS linting
- lintTypescript: TS linting
- lintHtml: HTML linting
......@@ -136,7 +136,7 @@ Options:
- pdo_sqlsrv
-d <mariadb|mysql|mssql|postgres|sqlite>
Only with -s install|functional|acceptance
Only with -s functional|acceptance|acceptanceInstall
Specifies on which DBMS tests are performed
- mariadb (default): use mariadb
- mysql: use MySQL server
......@@ -188,7 +188,7 @@ Options:
named "canRetrieveValueWithGP"
-x
Only with -s functional|unit|unitDeprecated|unitRandom|acceptance|install
Only with -s functional|unit|unitDeprecated|unitRandom|acceptance|acceptanceInstall
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
......@@ -204,7 +204,7 @@ Options:
replay the unit tests in that order.
-n
Only with -s cglGit|cglAll
Only with -s cgl|cglGit
Activate dry-run in CGL check that does not actively change files and only prints broken ones.
-u
......@@ -243,17 +243,14 @@ Examples:
# Run functional tests on mariadb 10.5
./Build/Scripts/runTests.sh -d mariadb -i 10.5
# Run install tests on mysql 8.0
.Build/Scripts/runTests.sh -d mysql -j 8.0
# Run functional tests on postgres 11
./Build/Scripts/runTests.sh -d postgres -k 11
./Build/Scripts/runTests.sh -s functional -d postgres -k 11
# Run restricted set of backend acceptance tests
./Build/Scripts/runTests.sh -s acceptance typo3/sysext/core/Tests/Acceptance/Backend/Login/BackendLoginCest.php:loginButtonMouseOver
# Run installer tests of a new instance on sqlite
./Build/Scripts/runTests.sh -s install -d sqlite
./Build/Scripts/runTests.sh -s acceptanceInstall -d sqlite
EOF
# Test if docker-compose exists, else exit out with error
......@@ -450,6 +447,40 @@ case ${TEST_SUITE} in
esac
docker-compose down
;;
acceptanceInstall)
handleDbmsAndDriverOptions
setUpDockerComposeDotEnv
case ${DBMS} in
mysql)
echo "Using driver: ${DATABASE_DRIVER}"
docker-compose run prepare_acceptance_install_mysql
docker-compose run acceptance_install_mysql
SUITE_EXIT_CODE=$?
;;
mariadb)
echo "Using driver: ${DATABASE_DRIVER}"
docker-compose run prepare_acceptance_install_mariadb
docker-compose run acceptance_install_mariadb
SUITE_EXIT_CODE=$?
;;
postgres)
docker-compose run prepare_acceptance_install_postgres
docker-compose run acceptance_install_postgres
SUITE_EXIT_CODE=$?
;;
sqlite)
docker-compose run prepare_acceptance_install_sqlite
docker-compose run acceptance_install_sqlite
SUITE_EXIT_CODE=$?
;;
*)
echo "Acceptance install tests don't run with DBMS ${DBMS}" >&2
echo >&2
echo "call \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2
exit 1
esac
docker-compose down
;;
buildCss)
setUpDockerComposeDotEnv
docker-compose run build_css
......@@ -462,14 +493,8 @@ case ${TEST_SUITE} in
SUITE_EXIT_CODE=$?
docker-compose down
;;
cglGit)
setUpDockerComposeDotEnv
docker-compose run cgl_git
SUITE_EXIT_CODE=$?
docker-compose down
;;
cglAll)
# Active dry-run for cglAll needs not "-n" but specific options
cgl)
# Active dry-run for cgl needs not "-n" but specific options
if [[ ! -z ${CGLCHECK_DRY_RUN} ]]; then
CGLCHECK_DRY_RUN="--dry-run --diff --diff-format udiff"
fi
......@@ -478,6 +503,12 @@ case ${TEST_SUITE} in
SUITE_EXIT_CODE=$?
docker-compose down
;;
cglGit)
setUpDockerComposeDotEnv
docker-compose run cgl_git
SUITE_EXIT_CODE=$?
docker-compose down
;;
checkAnnotations)
setUpDockerComposeDotEnv
docker-compose run check_annotations
......@@ -617,41 +648,7 @@ case ${TEST_SUITE} in
esac
docker-compose down
;;
install)
handleDbmsAndDriverOptions
setUpDockerComposeDotEnv
case ${DBMS} in
mysql)
echo "Using driver: ${DATABASE_DRIVER}"
docker-compose run prepare_acceptance_install_mysql
docker-compose run acceptance_install_mysql
SUITE_EXIT_CODE=$?
;;
mariadb)
echo "Using driver: ${DATABASE_DRIVER}"
docker-compose run prepare_acceptance_install_mariadb
docker-compose run acceptance_install_mariadb
SUITE_EXIT_CODE=$?
;;
postgres)
docker-compose run prepare_acceptance_install_postgres
docker-compose run acceptance_install_postgres
SUITE_EXIT_CODE=$?
;;
sqlite)
docker-compose run prepare_acceptance_install_sqlite
docker-compose run acceptance_install_sqlite
SUITE_EXIT_CODE=$?
;;
*)
echo "Install tests don't run with DBMS ${DBMS}" >&2
echo >&2
echo "call \".Build/Scripts/runTests.sh -h\" to display help and valid options" >&2
exit 1
esac
docker-compose down
;;
lint)
lintPhp)
setUpDockerComposeDotEnv
docker-compose run lint_php
SUITE_EXIT_CODE=$?
......@@ -752,7 +749,7 @@ if [ ${SCRIPT_VERBOSE} -eq 1 ]; then
fi
echo "" >&2
echo "###########################################################################" >&2
if [[ ${TEST_SUITE} =~ ^(functional|install|acceptance)$ ]]; then
if [[ ${TEST_SUITE} =~ ^(functional|acceptance|acceptanceInstall)$ ]]; then
echo "Result of ${TEST_SUITE}" >&2
echo "PHP: ${PHP_VERSION}" >&2
echo "${DBMS_OUTPUT}" >&2
......
......@@ -8,7 +8,7 @@ acceptance install mariadb php 7.4 locked:
- typo3temp/var/tests/AcceptanceReports
script:
- Build/Scripts/runTests.sh -s composerInstall -p 7.4
- Build/Scripts/runTests.sh -s install -d mariadb -i 10.3 -p 7.4
- Build/Scripts/runTests.sh -s acceptanceInstall -d mariadb -i 10.3 -p 7.4
acceptance install mariadb php 7.4 max:
stage: acceptance
only:
......@@ -23,7 +23,7 @@ acceptance install mariadb php 7.4 max:
- typo3temp/var/tests/AcceptanceReports
script:
- Build/Scripts/runTests.sh -s composerInstallMax -p 7.4
- Build/Scripts/runTests.sh -s install -d mariadb -i 10.3 -p 7.4
- Build/Scripts/runTests.sh -s acceptanceInstall -d mariadb -i 10.3 -p 7.4
acceptance install mariadb php 7.4 min:
stage: acceptance
only:
......@@ -38,7 +38,7 @@ acceptance install mariadb php 7.4 min:
- typo3temp/var/tests/AcceptanceReports
script:
- Build/Scripts/runTests.sh -s composerInstallMin -p 7.4
- Build/Scripts/runTests.sh -s install -d mariadb -i 10.3 -p 7.4
- Build/Scripts/runTests.sh -s acceptanceInstall -d mariadb -i 10.3 -p 7.4
acceptance install mariadb php 8.0 locked:
stage: acceptance
......@@ -50,7 +50,7 @@ acceptance install mariadb php 8.0 locked:
- typo3temp/var/tests/AcceptanceReports
script:
- Build/Scripts/runTests.sh -s composerInstall -p 8.0
- Build/Scripts/runTests.sh -s install -d mariadb -i 10.3 -p 8.0
- Build/Scripts/runTests.sh -s acceptanceInstall -d mariadb -i 10.3 -p 8.0
acceptance install mariadb php 8.0 max:
stage: acceptance
only:
......@@ -65,7 +65,7 @@ acceptance install mariadb php 8.0 max:
- typo3temp/var/tests/AcceptanceReports
script:
- Build/Scripts/runTests.sh -s composerInstallMax -p 8.0
- Build/Scripts/runTests.sh -s install -d mariadb -i 10.3 -p 8.0
- Build/Scripts/runTests.sh -s acceptanceInstall -d mariadb -i 10.3 -p 8.0
acceptance install mariadb php 8.0 min:
stage: acceptance
only:
......@@ -80,7 +80,7 @@ acceptance install mariadb php 8.0 min:
- typo3temp/var/tests/AcceptanceReports
script:
- Build/Scripts/runTests.sh -s composerInstallMin -p 8.0
- Build/Scripts/runTests.sh -s install -d mariadb -i 10.3 -p 8.0
- Build/Scripts/runTests.sh -s acceptanceInstall -d mariadb -i 10.3 -p 8.0
acceptance install mysql php 7.4:
stage: acceptance
......@@ -92,7 +92,7 @@ acceptance install mysql php 7.4:
- typo3temp/var/tests/AcceptanceReports
script:
- Build/Scripts/runTests.sh -s composerInstall -p 7.4
- Build/Scripts/runTests.sh -s install -d mysql -j 5.5 -p 7.4
- Build/Scripts/runTests.sh -s acceptanceInstall -d mysql -j 5.5 -p 7.4
acceptance install mysql php 7.4 max:
stage: acceptance
only:
......@@ -107,7 +107,7 @@ acceptance install mysql php 7.4 max:
- typo3temp/var/tests/AcceptanceReports
script:
- Build/Scripts/runTests.sh -s composerInstallMax -p 7.4
- Build/Scripts/runTests.sh -s install -d mysql -j 5.5 -p 7.4
- Build/Scripts/runTests.sh -s acceptanceInstall -d mysql -j 5.5 -p 7.4
acceptance install mysql php 7.4 min:
stage: acceptance
only:
......@@ -122,7 +122,7 @@ acceptance install mysql php 7.4 min:
- typo3temp/var/tests/AcceptanceReports
script:
- Build/Scripts/runTests.sh -s composerInstallMin -p 7.4
- Build/Scripts/runTests.sh -s install -d mysql -j 5.5 -p 7.4
- Build/Scripts/runTests.sh -s acceptanceInstall -d mysql -j 5.5 -p 7.4
acceptance install mysql php 8.0:
stage: acceptance
......@@ -134,7 +134,7 @@ acceptance install mysql php 8.0:
- typo3temp/var/tests/AcceptanceReports
script:
- Build/Scripts/runTests.sh -s composerInstall -p 8.0
- Build/Scripts/runTests.sh -s install -d mysql -j 5.5 -p 8.0
- Build/Scripts/runTests.sh -s acceptanceInstall -d mysql -j 5.5 -p 8.0
acceptance install mysql php 8.0 max:
stage: acceptance
only:
......@@ -149,7 +149,7 @@ acceptance install mysql php 8.0 max:
- typo3temp/var/tests/AcceptanceReports
script:
- Build/Scripts/runTests.sh -s composerInstallMax -p 8.0
- Build/Scripts/runTests.sh -s install -d mysql -j 5.5 -p 8.0
- Build/Scripts/runTests.sh -s acceptanceInstall -d mysql -j 5.5 -p 8.0
acceptance install mysql php 8.0 min:
stage: acceptance
only:
......@@ -164,7 +164,7 @@ acceptance install mysql php 8.0 min:
- typo3temp/var/tests/AcceptanceReports
script:
- Build/Scripts/runTests.sh -s composerInstallMin -p 8.0
- Build/Scripts/runTests.sh -s install -d mysql -j 5.5 -p 8.0
- Build/Scripts/runTests.sh -s acceptanceInstall -d mysql -j 5.5 -p 8.0
acceptance install postgres php 7.4 locked:
stage: acceptance
......@@ -176,7 +176,7 @@ acceptance install postgres php 7.4 locked:
- typo3temp/var/tests/AcceptanceReports
script:
- Build/Scripts/runTests.sh -s composerInstall -p 7.4
- Build/Scripts/runTests.sh -s install -d postgres -k 10 -p 7.4
- Build/Scripts/runTests.sh -s acceptanceInstall -d postgres -k 10 -p 7.4
acceptance install postgres php 7.4 max:
stage: acceptance
only:
......@@ -191,7 +191,7 @@ acceptance install postgres php 7.4 max:
- typo3temp/var/tests/AcceptanceReports
script:
- Build/Scripts/runTests.sh -s composerInstallMax -p 7.4
- Build/Scripts/runTests.sh -s install -d postgres -k 10 -p 7.4
- Build/Scripts/runTests.sh -s acceptanceInstall -d postgres -k 10 -p 7.4
acceptance install postgres php 7.4 min:
stage: acceptance
only:
......@@ -206,7 +206,7 @@ acceptance install postgres php 7.4 min:
- typo3temp/var/tests/AcceptanceReports
script:
- Build/Scripts/runTests.sh -s composerInstallMin -p 7.4
- Build/Scripts/runTests.sh -s install -d postgres -k 10 -p 7.4
- Build/Scripts/runTests.sh -s acceptanceInstall -d postgres -k 10 -p 7.4
acceptance install postgres php 8.0 locked:
stage: acceptance
......@@ -218,7 +218,7 @@ acceptance install postgres php 8.0 locked:
- typo3temp/var/tests/AcceptanceReports
script:
- Build/Scripts/runTests.sh -s composerInstall -p 8.0
- Build/Scripts/runTests.sh -s install -d postgres -k 10 -p 8.0
- Build/Scripts/runTests.sh -s acceptanceInstall -d postgres -k 10 -p 8.0
acceptance install postgres php 8.0 max:
stage: acceptance
only:
......@@ -233,7 +233,7 @@ acceptance install postgres php 8.0 max:
- typo3temp/var/tests/AcceptanceReports
script:
- Build/Scripts/runTests.sh -s composerInstallMax -p 8.0
- Build/Scripts/runTests.sh -s install -d postgres -k 10 -p 8.0
- Build/Scripts/runTests.sh -s acceptanceInstall -d postgres -k 10 -p 8.0
acceptance install postgres php 8.0 min:
stage: acceptance
only:
......@@ -248,7 +248,7 @@ acceptance install postgres php 8.0 min:
- typo3temp/var/tests/AcceptanceReports
script:
- Build/Scripts/runTests.sh -s composerInstallMin -p 8.0
- Build/Scripts/runTests.sh -s install -d postgres -k 10 -p 8.0
- Build/Scripts/runTests.sh -s acceptanceInstall -d postgres -k 10 -p 8.0
acceptance install sqlite php 7.4 locked:
stage: acceptance
......@@ -260,7 +260,7 @@ acceptance install sqlite php 7.4 locked:
- typo3temp/var/tests/AcceptanceReports
script:
- Build/Scripts/runTests.sh -s composerInstall -p 7.4
- Build/Scripts/runTests.sh -s install -d sqlite -p 7.4
- Build/Scripts/runTests.sh -s acceptanceInstall -d sqlite -p 7.4
acceptance install sqlite php 7.4 max:
stage: acceptance
only:
......@@ -275,7 +275,7 @@ acceptance install sqlite php 7.4 max:
- typo3temp/var/tests/AcceptanceReports
script:
- Build/Scripts/runTests.sh -s composerInstallMax -p 7.4
- Build/Scripts/runTests.sh -s install -d sqlite -p 7.4
- Build/Scripts/runTests.sh -s acceptanceInstall -d sqlite -p 7.4
acceptance install sqlite php 7.4 min:
stage: acceptance
only:
......@@ -290,7 +290,7 @@ acceptance install sqlite php 7.4 min:
- typo3temp/var/tests/AcceptanceReports
script:
- Build/Scripts/runTests.sh -s composerInstallMin -p 7.4
- Build/Scripts/runTests.sh -s install -d sqlite -p 7.4
- Build/Scripts/runTests.sh -s acceptanceInstall -d sqlite -p 7.4
acceptance install sqlite php 8.0 locked:
stage: acceptance
......@@ -302,7 +302,7 @@ acceptance install sqlite php 8.0 locked:
- typo3temp/var/tests/AcceptanceReports
script:
- Build/Scripts/runTests.sh -s composerInstall -p 8.0
- Build/Scripts/runTests.sh -s install -d sqlite -p 8.0
- Build/Scripts/runTests.sh -s acceptanceInstall -d sqlite -p 8.0
acceptance install sqlite php 8.0 max:
stage: acceptance
only:
......@@ -317,7 +317,7 @@ acceptance install sqlite php 8.0 max:
- typo3temp/var/tests/AcceptanceReports
script:
- Build/Scripts/runTests.sh -s composerInstallMax -p 8.0
- Build/Scripts/runTests.sh -s install -d sqlite -p 8.0
- Build/Scripts/runTests.sh -s acceptanceInstall -d sqlite -p 8.0
acceptance install sqlite php 8.0 min:
stage: acceptance
only:
......@@ -332,4 +332,4 @@ acceptance install sqlite php 8.0 min:
- typo3temp/var/tests/AcceptanceReports
script:
- Build/Scripts/runTests.sh -s composerInstallMin -p 8.0
- Build/Scripts/runTests.sh -s install -d sqlite -p 8.0
- Build/Scripts/runTests.sh -s acceptanceInstall -d sqlite -p 8.0
......@@ -6,13 +6,13 @@ annotations php 7.4:
- Build/Scripts/runTests.sh -s composerInstall -p 7.4
- Build/Scripts/runTests.sh -s checkAnnotations -p 7.4
cgl all:
cgl:
stage: integrity
only:
- schedules
script:
- Build/Scripts/runTests.sh -s composerInstall -p 7.4
- Build/Scripts/runTests.sh -s cglAll -n -p 7.4
- Build/Scripts/runTests.sh -s cgl -n -p 7.4
composer validate:
stage: integrity
......@@ -56,13 +56,13 @@ lint php 7.4:
only:
- schedules
script:
- Build/Scripts/runTests.sh -s lint -p 7.4
- Build/Scripts/runTests.sh -s lintPhp -p 7.4
lint php 8.0:
stage: integrity
only:
- schedules
script:
- Build/Scripts/runTests.sh -s lint -p 8.0
- Build/Scripts/runTests.sh -s lintPhp -p 8.0
lint scss ts html:
stage: integrity
......
......@@ -10,7 +10,7 @@ acceptance install mariadb php 7.4 pre-merge:
- typo3temp/var/tests/AcceptanceReports
script:
- Build/Scripts/runTests.sh -s composerInstall -p 7.4
- Build/Scripts/runTests.sh -s install -d mariadb -i 10.3 -p 7.4
- Build/Scripts/runTests.sh -s acceptanceInstall -d mariadb -i 10.3 -p 7.4
acceptance install mysql php 8.0 pre-merge:
stage: main
......@@ -24,7 +24,7 @@ acceptance install mysql php 8.0 pre-merge:
- typo3temp/var/tests/AcceptanceReports
script:
- Build/Scripts/runTests.sh -s composerInstall -p 8.0
- Build/Scripts/runTests.sh -s install -d mysql -j 5.5 -p 8.0
- Build/Scripts/runTests.sh -s acceptanceInstall -d mysql -j 5.5 -p 8.0
acceptance install postgres php 7.4 pre-merge:
stage: main
......@@ -38,7 +38,7 @@ acceptance install postgres php 7.4 pre-merge:
- typo3temp/var/tests/AcceptanceReports
script:
- Build/Scripts/runTests.sh -s composerInstall -p 7.4
- Build/Scripts/runTests.sh -s install -d postgres -k 10 -p 7.4
- Build/Scripts/runTests.sh -s acceptanceInstall -d postgres -k 10 -p 7.4
acceptance install sqlite php 8.0 pre-merge:
stage: main
......@@ -52,4 +52,4 @@ acceptance install sqlite php 8.0 pre-merge:
- typo3temp/var/tests/AcceptanceReports
script:
- Build/Scripts/runTests.sh -s composerInstall -p 8.0
- Build/Scripts/runTests.sh -s install -d sqlite -p 8.0
- Build/Scripts/runTests.sh -s acceptanceInstall -d sqlite -p 8.0
......@@ -42,23 +42,6 @@ integration various php 7.4 pre-merge:
- Build/Scripts/runTests.sh -s checkBom -p 7.4
- Build/Scripts/runTests.sh -s checkComposer -p 7.4
lint php 7.4 pre-merge:
stage: main
except:
refs:
- schedules
- master
script:
- Build/Scripts/runTests.sh -s lint -p 7.4
lint php 8.0 pre-merge:
stage: main
except:
refs:
- schedules
- master
script:
- Build/Scripts/runTests.sh -s lint -p 8.0
lint scss ts html pre-merge:
stage: main
except:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment