Commit 27ff588c authored by Christian Kuhn's avatar Christian Kuhn
Browse files

[TASK] runTests.sh: Acceptance tests with mysql and postgres

Allow mysql & postgres for acceptance tests in
addition to default mariadb:

* Build/Script/runTests.sh -s acceptance -d mysql
* Build/Script/runTests.sh -s acceptance -d postgres

Change-Id: If65f1d8d8b4443107d655948ce87af4390d9681f
Resolves: #93405
Releases: master, 10.4, 9.5
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/67623


Tested-by: Simon Gilli's avatarSimon Gilli <typo3@gilbertsoft.org>
Tested-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Simon Gilli's avatarSimon Gilli <typo3@gilbertsoft.org>
Reviewed-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent bef361be
......@@ -107,7 +107,7 @@ Options:
- pdo_sqlsrv
-d <mariadb|mysql|mssql|postgres|sqlite>
Only with -s install|functional
Only with -s install|functional|acceptance
Specifies on which DBMS tests are performed
- mariadb (default): use mariadb
- mysql: use MySQL server
......@@ -371,9 +371,30 @@ case ${TEST_SUITE} in
if [ ${CHUNKS} -gt 1 ]; then
docker-compose run acceptance_split
fi
docker-compose run prepare_acceptance_backend_mariadb
docker-compose run acceptance_backend_mariadb
SUITE_EXIT_CODE=$?
case ${DBMS} in
mysql)
[[ ! -z "$DATABASE_DRIVER" ]] && echo "Using driver: ${DATABASE_DRIVER}"
docker-compose run prepare_acceptance_backend_mysql
docker-compose run acceptance_backend_mysql
SUITE_EXIT_CODE=$?
;;
mariadb)
[[ ! -z "$DATABASE_DRIVER" ]] && echo "Using driver: ${DATABASE_DRIVER}"
docker-compose run prepare_acceptance_backend_mariadb
docker-compose run acceptance_backend_mariadb
SUITE_EXIT_CODE=$?
;;
postgres)
docker-compose run prepare_acceptance_backend_postgres
docker-compose run acceptance_backend_postgres
SUITE_EXIT_CODE=$?
;;
*)
echo "Acceptance 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
;;
acceptancePagetree)
......@@ -572,11 +593,13 @@ case ${TEST_SUITE} in
setUpDockerComposeDotEnv
case ${DBMS} in
mysql)
[[ ! -z "$DATABASE_DRIVER" ]] && echo "Using driver: ${DATABASE_DRIVER}"
docker-compose run prepare_acceptance_install_mysql
docker-compose run acceptance_install_mysql
SUITE_EXIT_CODE=$?
;;
mariadb)
[[ ! -z "$DATABASE_DRIVER" ]] && echo "Using driver: ${DATABASE_DRIVER}"
docker-compose run prepare_acceptance_install_mariadb
docker-compose run acceptance_install_mariadb
SUITE_EXIT_CODE=$?
......
......@@ -101,6 +101,103 @@ services:
$${COMMAND}
"
prepare_acceptance_backend_mysql:
image: alpine:3.8
links:
- mysql
- chrome
- web
command: >
/bin/sh -c "
if [ ${SCRIPT_VERBOSE} -eq 1 ]; then
set -x
fi
echo Waiting for database start...;
while ! nc -z mysql 3306; do
sleep 1;
done;
echo Database is up;
"
acceptance_backend_mysql:
image: typo3/core-testing-${DOCKER_PHP_IMAGE}:latest
user: ${HOST_UID}
environment:
typo3DatabaseName: func_test
typo3DatabaseUsername: root
typo3DatabasePassword: funcp
typo3DatabaseHost: mysql
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- /etc/group:/etc/group:ro
working_dir: ${CORE_ROOT}
command: >
/bin/sh -c "
if [ ${SCRIPT_VERBOSE} -eq 1 ]; then
set -x
fi
php -v | grep '^PHP'
if [ ${CHUNKS} -gt 0 ]; then
echo \"Running chunk ${THISCHUNK}\"
COMMAND=\"bin/codecept run Backend -d -g AcceptanceTests-Job-${THISCHUNK} -c typo3/sysext/core/Tests/codeception.yml ${TEST_FILE} --xml reports.xml --html reports.html\"
else
COMMAND=\"bin/codecept run Backend -d -c typo3/sysext/core/Tests/codeception.yml ${TEST_FILE} --xml reports.xml --html reports.html\"
fi
mkdir -p typo3temp/var/tests/
$${COMMAND}
"
prepare_acceptance_backend_postgres:
image: alpine:3.8
links:
- postgres
- chrome
- web
command: >
/bin/sh -c "
if [ ${SCRIPT_VERBOSE} -eq 1 ]; then
set -x
fi
echo Waiting for database start...;
while ! nc -z postgres 5432; do
sleep 1;
done;
echo Database is up;
"
acceptance_backend_postgres:
image: typo3/core-testing-${DOCKER_PHP_IMAGE}:latest
user: ${HOST_UID}
volumes:
- ${CORE_ROOT}:${CORE_ROOT}
- ${HOST_HOME}:${HOST_HOME}
- /etc/passwd:/etc/passwd:ro
- /etc/group:/etc/group:ro
environment:
typo3DatabaseDriver: pdo_pgsql
typo3DatabaseName: bamboo
typo3DatabaseUsername: funcu
typo3DatabaseHost: postgres
typo3DatabasePassword: funcp
typo3TestingRedisHost: redis4
typo3TestingMemcachedHost: memcached1-5
working_dir: ${CORE_ROOT}
command: >
/bin/sh -c "
if [ ${SCRIPT_VERBOSE} -eq 1 ]; then
set -x
fi
php -v | grep '^PHP'
if [ ${CHUNKS} -gt 0 ]; then
echo \"Running chunk ${THISCHUNK}\"
COMMAND=\"bin/codecept run Backend -d -g AcceptanceTests-Job-${THISCHUNK} -c typo3/sysext/core/Tests/codeception.yml ${TEST_FILE} --xml reports.xml --html reports.html\"
else
COMMAND=\"bin/codecept run Backend -d -c typo3/sysext/core/Tests/codeception.yml ${TEST_FILE} --xml reports.xml --html reports.html\"
fi
mkdir -p typo3temp/var/tests/
$${COMMAND}
"
prepare_acceptance_pagetree_mariadb:
image: alpine:3.8
links:
......
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