Skip to content

Commit

Permalink
[TASK] Adjust tests and update runTests.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ochorocho committed Nov 26, 2024
1 parent a9d19a4 commit c383fa4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 26 deletions.
44 changes: 22 additions & 22 deletions Build/Scripts/runTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#

# Function to write a .env file in Build/testing-docker
# This is read by docker-compose and vars defined here are
# This is read by "docker compose" and vars defined here are
# used in Build/testing-docker/docker-compose.yml
setUpDockerComposeDotEnv() {
# Delete possibly existing local .env file if exists
Expand All @@ -14,7 +14,7 @@ setUpDockerComposeDotEnv() {
{
echo "COMPOSE_PROJECT_NAME=local"
# To prevent access rights of files created by the testing, the docker image later
# runs with the same user that is currently executing the script. docker-compose can't
# runs with the same user that is currently executing the script. "docker compose" can't
# use $UID directly itself since it is a shell variable and not an env variable, so
# we have to set it explicitly here.
echo "HOST_UID=`id -u`"
Expand Down Expand Up @@ -115,8 +115,8 @@ Examples:
EOF

# Test if docker-compose exists, else exit out with error
if ! type "docker-compose" > /dev/null; then
echo "This script relies on docker and docker-compose. Please install" >&2
if ! type "docker" > /dev/null; then
echo "This script relies on docker. Please install" >&2
exit 1
fi

Expand Down Expand Up @@ -233,46 +233,46 @@ fi
case ${TEST_SUITE} in
acceptance)
setUpDockerComposeDotEnv
docker-compose run acceptance_backend_mariadb10
docker compose run acceptance_backend_mariadb10
SUITE_EXIT_CODE=$?
docker-compose down
docker compose down
;;
cgl)
# Active dry-run for cgl needs not "-n" but specific options
if [ -n "${CGLCHECK_DRY_RUN}" ]; then
CGLCHECK_DRY_RUN="--dry-run --diff"
fi
setUpDockerComposeDotEnv
docker-compose run cgl
docker compose run cgl
SUITE_EXIT_CODE=$?
docker-compose down
docker compose down
;;
composerUpdate)
setUpDockerComposeDotEnv
docker-compose run composer_update
docker compose run composer_update
SUITE_EXIT_CODE=$?
docker-compose down
docker compose down
;;
composerValidate)
setUpDockerComposeDotEnv
docker-compose run composer_validate
docker compose run composer_validate
SUITE_EXIT_CODE=$?
docker-compose down
docker compose down
;;
functional)
setUpDockerComposeDotEnv
case ${DBMS} in
mariadb)
docker-compose run functional_mariadb10
docker compose run functional_mariadb10
SUITE_EXIT_CODE=$?
;;
postgres)
docker-compose run functional_postgres10
docker compose run functional_postgres10
SUITE_EXIT_CODE=$?
;;
sqlite)
mkdir -p ${CORE_ROOT}/.Build/Web/typo3temp/var/tests/functional-sqlite-dbs/
docker-compose run functional_sqlite
docker compose run functional_sqlite
SUITE_EXIT_CODE=$?
;;
*)
Expand All @@ -281,25 +281,25 @@ case ${TEST_SUITE} in
echo "${HELP}" >&2
exit 1
esac
docker-compose down
docker compose down
;;
lint)
setUpDockerComposeDotEnv
docker-compose run lint
docker compose run lint
SUITE_EXIT_CODE=$?
docker-compose down
docker compose down
;;
phpstan)
setUpDockerComposeDotEnv
docker-compose run phpstan
docker compose run phpstan
SUITE_EXIT_CODE=$?
docker-compose down
docker compose down
;;
unit)
setUpDockerComposeDotEnv
docker-compose run unit
docker compose run unit
SUITE_EXIT_CODE=$?
docker-compose down
docker compose down
;;
update)
# pull typo3/core-testing-*:latest versions of those ones that exist locally
Expand Down
1 change: 0 additions & 1 deletion Build/testing-docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '2.3'
services:
chrome:
# Image for Mac M1
Expand Down
5 changes: 2 additions & 3 deletions Tests/Acceptance/Backend/PluginFormCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ public function seeOverrideTemplateOptions(BackendTester $I): void

$I->amGoingTo('See a list of expected email template pages in select of form plugin override');
$actual = $I->grabMultiple('//label[contains(text(),"Select email template")]/following-sibling::div//select//option');
$I->assertStringContainsString('Default', $actual[0]);
$I->assertStringContainsString('Contact template', $actual[1]);
$I->assertStringContainsString('Shopping cart template', $actual[2]);
$I->assertStringContainsString('Contact template', $actual[0]);
$I->assertStringContainsString('Shopping cart template', $actual[1]);
}

/**
Expand Down

0 comments on commit c383fa4

Please sign in to comment.