Skip to content

Commit 55d13ac

Browse files
committed
[TASK] CI for PHP 8.5
* change docker image * remove unused code in runTests.sh
1 parent 6d187b4 commit 55d13ac

3 files changed

Lines changed: 7 additions & 287 deletions

File tree

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-24.04
1414
strategy:
1515
matrix:
16-
php: [ '8.2']
16+
php: [ '8.2', '8.5']
1717
TYPO3: [ '13', '14' ]
1818
steps:
1919
- name: Checkout repository

Build/Scripts/runTests.sh

Lines changed: 1 addition & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -49,43 +49,20 @@ No arguments: Run all unit tests with PHP 8.0
4949
Options:
5050
-s <...>
5151
Specifies which test suite to run
52-
- acceptance: backend acceptance tests
5352
- cgl: cgl test and fix all php files
5453
- composerUpdate: "composer update", handy if host has no PHP
5554
- composerValidate: "composer validate"
56-
- functional: functional tests
5755
- lint: PHP linting
5856
- phpstan: phpstan analyze
59-
- unit (default): PHP unit tests
6057
6158
-t <13|14>
6259
Only with -s composerUpdate|acceptance|functional
6360
TYPO3 core major version the extension is embedded in for testing.
6461
65-
-d <mariadb|postgres|sqlite>
66-
Only with -s functional
67-
Specifies on which DBMS tests are performed
68-
- mariadb (default): use mariadb
69-
- postgres: use postgres
70-
- sqlite: use sqlite
71-
7262
-p <8.2|8.3|8.4|8.5>
7363
Specifies the PHP minor version to be used
7464
- 8.2 (default): use PHP 8.2
7565
76-
-e "<phpunit or codeception options>"
77-
Only with -s acceptance|functional|unit
78-
Additional options to send to phpunit (unit & functional tests) or codeception (acceptance
79-
tests). For phpunit, options starting with "--" must be added after options starting with "-".
80-
Example -e "-v --filter canRetrieveValueWithGP" to enable verbose output AND filter tests
81-
named "canRetrieveValueWithGP"
82-
83-
-x
84-
Only with -s functional|unit|acceptance
85-
Send information to host instance for test or system under test break points. This is especially
86-
useful if a local PhpStorm instance is listening on default xdebug port 9003. A different port
87-
can be selected with -y
88-
8966
-y <port>
9067
Send xdebug information to a different port than default 9003 if an IDE like PhpStorm
9168
is not listening on default port.
@@ -207,7 +184,7 @@ if [ ${#INVALID_OPTIONS[@]} -ne 0 ]; then
207184
fi
208185

209186
# Move "7.4" to "php74", the latter is the docker container name
210-
DOCKER_PHP_IMAGE=$(echo "php${PHP_VERSION}" | sed -e 's/\.//')
187+
DOCKER_PHP_IMAGE="ghcr.io/typo3/core-testing-$(echo "php${PHP_VERSION}" | sed -e 's/\.//'):latest"
211188

212189
# Set $1 to first mass argument, this is the optional test file or test directory to execute
213190
shift $((OPTIND - 1))
@@ -222,12 +199,6 @@ fi
222199

223200
# Suite execution
224201
case ${TEST_SUITE} in
225-
acceptance)
226-
setUpDockerComposeDotEnv
227-
docker compose run acceptance_backend_mariadb10
228-
SUITE_EXIT_CODE=$?
229-
docker compose down
230-
;;
231202
cgl)
232203
# Active dry-run for cgl needs not "-n" but specific options
233204
if [ -n "${CGLCHECK_DRY_RUN}" ]; then
@@ -250,30 +221,6 @@ case ${TEST_SUITE} in
250221
SUITE_EXIT_CODE=$?
251222
docker compose down
252223
;;
253-
functional)
254-
setUpDockerComposeDotEnv
255-
case ${DBMS} in
256-
mariadb)
257-
docker compose run functional_mariadb10
258-
SUITE_EXIT_CODE=$?
259-
;;
260-
postgres)
261-
docker compose run functional_postgres10
262-
SUITE_EXIT_CODE=$?
263-
;;
264-
sqlite)
265-
mkdir -p ${CORE_ROOT}/.Build/Web/typo3temp/var/tests/functional-sqlite-dbs/
266-
docker compose run functional_sqlite
267-
SUITE_EXIT_CODE=$?
268-
;;
269-
*)
270-
echo "Invalid -d option argument ${DBMS}" >&2
271-
echo >&2
272-
echo "${HELP}" >&2
273-
exit 1
274-
esac
275-
docker compose down
276-
;;
277224
lint)
278225
setUpDockerComposeDotEnv
279226
docker compose run lint
Lines changed: 5 additions & 232 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,7 @@
11
services:
2-
chrome:
3-
# Image for Mac M1
4-
# image: seleniarm/standalone-chromium:4.1.2-20220227
5-
image: selenium/standalone-chrome:4.0.0-20211102
6-
tmpfs:
7-
- /dev/shm:rw,nosuid,nodev,noexec,relatime
8-
9-
mariadb10:
10-
# not using mariadb:10 for the time being, because 10.5.7 (currently latest) is broken
11-
image: mariadb:10.5.6
12-
environment:
13-
MYSQL_ROOT_PASSWORD: funcp
14-
tmpfs:
15-
- /var/lib/mysql/:rw,noexec,nosuid
16-
17-
postgres10:
18-
image: postgres:10-alpine
19-
environment:
20-
POSTGRES_PASSWORD: funcp
21-
POSTGRES_USER: ${HOST_USER}
22-
tmpfs:
23-
- /var/lib/postgresql/data:rw,noexec,nosuid
24-
25-
web:
26-
image: typo3/core-testing-${DOCKER_PHP_IMAGE}:latest
27-
user: "${HOST_UID}"
28-
stop_grace_period: 1s
29-
volumes:
30-
- ${CORE_ROOT}:${CORE_ROOT}
31-
- /etc/passwd:/etc/passwd:ro
32-
- /etc/group:/etc/group:ro
33-
environment:
34-
TYPO3_PATH_ROOT: ${CORE_ROOT}/.Build/Web/typo3temp/var/tests/acceptance
35-
TYPO3_PATH_APP: ${CORE_ROOT}/.Build/Web/typo3temp/var/tests/acceptance
36-
command: >
37-
/bin/sh -c "
38-
if [ ${PHP_XDEBUG_ON} -eq 0 ]; then
39-
XDEBUG_MODE=\"off\" \
40-
php -S web:8000 -t ${CORE_ROOT}/.Build/Web
41-
else
42-
DOCKER_HOST=`route -n | awk '/^0.0.0.0/ { print $$2 }'`
43-
XDEBUG_MODE=\"debug,develop\" \
44-
XDEBUG_TRIGGER=\"foo\" \
45-
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=$${DOCKER_HOST}\" \
46-
php -S web:8000 -t ${CORE_ROOT}/.Build/Web
47-
fi
48-
"
49-
50-
acceptance_backend_mariadb10:
51-
image: typo3/core-testing-${DOCKER_PHP_IMAGE}:latest
52-
user: "${HOST_UID}"
53-
links:
54-
- mariadb10
55-
- chrome
56-
- web
57-
environment:
58-
typo3DatabaseName: func_test
59-
typo3DatabaseUsername: root
60-
typo3DatabasePassword: funcp
61-
typo3DatabaseHost: mariadb10
62-
volumes:
63-
- ${CORE_ROOT}:${CORE_ROOT}
64-
- ${HOST_HOME}:${HOST_HOME}
65-
- /etc/passwd:/etc/passwd:ro
66-
- /etc/group:/etc/group:ro
67-
working_dir: ${CORE_ROOT}/.Build
68-
command: >
69-
/bin/sh -c "
70-
if [ ${SCRIPT_VERBOSE} -eq 1 ]; then
71-
set -x
72-
fi
73-
echo Waiting for database start...;
74-
while ! nc -z mariadb10 3306; do
75-
sleep 1;
76-
done;
77-
echo Database is up;
78-
php -v | grep '^PHP';
79-
mkdir -p Web/typo3temp/var/tests/
80-
COMMAND=\"vendor/codeception/codeception/codecept run Backend -d -c Web/typo3conf/ext/form_custom_templates/Tests/codeception.yml ${TEST_FILE}\"
81-
if [ ${PHP_XDEBUG_ON} -eq 0 ]; then
82-
XDEBUG_MODE=\"off\" \
83-
$${COMMAND};
84-
else
85-
DOCKER_HOST=`route -n | awk '/^0.0.0.0/ { print $$2 }'`
86-
XDEBUG_MODE=\"debug,develop\" \
87-
XDEBUG_TRIGGER=\"foo\" \
88-
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=$${DOCKER_HOST}\" \
89-
$${COMMAND};
90-
fi
91-
"
922

933
cgl:
94-
image: typo3/core-testing-${DOCKER_PHP_IMAGE}:latest
4+
image: ${DOCKER_PHP_IMAGE}
955
user: "${HOST_UID}"
966
volumes:
977
- ${CORE_ROOT}:${CORE_ROOT}
@@ -109,7 +19,7 @@ services:
10919
"
11020
11121
composer_update:
112-
image: typo3/core-testing-${DOCKER_PHP_IMAGE}:latest
22+
image: ${DOCKER_PHP_IMAGE}
11323
user: "${HOST_UID}"
11424
volumes:
11525
- ${CORE_ROOT}:${CORE_ROOT}
@@ -127,7 +37,7 @@ services:
12737
"
12838
12939
composer_validate:
130-
image: typo3/core-testing-${DOCKER_PHP_IMAGE}:latest
40+
image: ${DOCKER_PHP_IMAGE}
13141
user: "${HOST_UID}"
13242
volumes:
13343
- ${CORE_ROOT}:${CORE_ROOT}
@@ -144,118 +54,8 @@ services:
14454
composer validate;
14555
"
14656
147-
functional_mariadb10:
148-
image: typo3/core-testing-${DOCKER_PHP_IMAGE}:latest
149-
user: "${HOST_UID}"
150-
links:
151-
- mariadb10
152-
volumes:
153-
- ${CORE_ROOT}:${CORE_ROOT}
154-
- ${HOST_HOME}:${HOST_HOME}
155-
- /etc/passwd:/etc/passwd:ro
156-
- /etc/group:/etc/group:ro
157-
environment:
158-
typo3DatabaseName: func_test
159-
typo3DatabaseUsername: root
160-
typo3DatabasePassword: funcp
161-
typo3DatabaseHost: mariadb10
162-
working_dir: ${CORE_ROOT}/.Build
163-
command: >
164-
/bin/sh -c "
165-
if [ ${SCRIPT_VERBOSE} -eq 1 ]; then
166-
set -x
167-
fi
168-
echo Waiting for database start...;
169-
while ! nc -z mariadb10 3306; do
170-
sleep 1;
171-
done;
172-
echo Database is up;
173-
php -v | grep '^PHP';
174-
if [ ${PHP_XDEBUG_ON} -eq 0 ]; then
175-
XDEBUG_MODE=\"off\" \
176-
bin/phpunit -c Web/typo3conf/ext/form_custom_templates/Build/FunctionalTests.xml ${EXTRA_TEST_OPTIONS} ${TEST_FILE};
177-
else
178-
DOCKER_HOST=`route -n | awk '/^0.0.0.0/ { print $$2 }'`
179-
XDEBUG_MODE=\"debug,develop\" \
180-
XDEBUG_TRIGGER=\"foo\" \
181-
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=$${DOCKER_HOST}\" \
182-
bin/phpunit -c Web/typo3conf/ext/form_custom_templates/Build/FunctionalTests.xml ${EXTRA_TEST_OPTIONS} ${TEST_FILE};
183-
fi
184-
"
185-
186-
functional_postgres10:
187-
image: typo3/core-testing-${DOCKER_PHP_IMAGE}:latest
188-
user: "${HOST_UID}"
189-
links:
190-
- postgres10
191-
volumes:
192-
- ${CORE_ROOT}:${CORE_ROOT}
193-
- ${HOST_HOME}:${HOST_HOME}
194-
- /etc/passwd:/etc/passwd:ro
195-
- /etc/group:/etc/group:ro
196-
environment:
197-
typo3DatabaseDriver: pdo_pgsql
198-
typo3DatabaseName: bamboo
199-
typo3DatabaseUsername: ${HOST_USER}
200-
typo3DatabaseHost: postgres10
201-
typo3DatabasePassword: funcp
202-
working_dir: ${CORE_ROOT}/.Build
203-
command: >
204-
/bin/sh -c "
205-
if [ ${SCRIPT_VERBOSE} -eq 1 ]; then
206-
set -x
207-
fi
208-
echo Waiting for database start...;
209-
while ! nc -z postgres10 5432; do
210-
sleep 1;
211-
done;
212-
echo Database is up;
213-
php -v | grep '^PHP';
214-
if [ ${PHP_XDEBUG_ON} -eq 0 ]; then
215-
XDEBUG_MODE=\"off\" \
216-
bin/phpunit -c Web/typo3conf/ext/form_custom_templates/Build/FunctionalTests.xml ${EXTRA_TEST_OPTIONS} --exclude-group not-postgres ${TEST_FILE};
217-
else
218-
DOCKER_HOST=`route -n | awk '/^0.0.0.0/ { print $$2 }'`
219-
XDEBUG_MODE=\"debug,develop\" \
220-
XDEBUG_TRIGGER=\"foo\" \
221-
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=$${DOCKER_HOST}\" \
222-
bin/phpunit -c Web/typo3conf/ext/form_custom_templates/Build/FunctionalTests.xml ${EXTRA_TEST_OPTIONS} --exclude-group not-postgres ${TEST_FILE};
223-
fi
224-
"
225-
226-
functional_sqlite:
227-
image: typo3/core-testing-${DOCKER_PHP_IMAGE}:latest
228-
user: "${HOST_UID}"
229-
volumes:
230-
- ${CORE_ROOT}:${CORE_ROOT}
231-
- ${HOST_HOME}:${HOST_HOME}
232-
- /etc/passwd:/etc/passwd:ro
233-
- /etc/group:/etc/group:ro
234-
tmpfs:
235-
- ${CORE_ROOT}/.Build/Web/typo3temp/var/tests/functional-sqlite-dbs/:rw,noexec,nosuid,uid=${HOST_UID}
236-
environment:
237-
typo3DatabaseDriver: pdo_sqlite
238-
working_dir: ${CORE_ROOT}/.Build
239-
command: >
240-
/bin/sh -c "
241-
if [ ${SCRIPT_VERBOSE} -eq 1 ]; then
242-
set -x
243-
fi
244-
php -v | grep '^PHP';
245-
if [ ${PHP_XDEBUG_ON} -eq 0 ]; then
246-
XDEBUG_MODE=\"off\" \
247-
bin/phpunit -c Web/typo3conf/ext/form_custom_templates/Build/FunctionalTests.xml ${EXTRA_TEST_OPTIONS} --exclude-group not-sqlite ${TEST_FILE};
248-
else
249-
DOCKER_HOST=`route -n | awk '/^0.0.0.0/ { print $$2 }'`
250-
XDEBUG_MODE=\"debug,develop\" \
251-
XDEBUG_TRIGGER=\"foo\" \
252-
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=$${DOCKER_HOST}\" \
253-
bin/phpunit -c Web/typo3conf/ext/form_custom_templates/Build/FunctionalTests.xml ${EXTRA_TEST_OPTIONS} --exclude-group not-sqlite ${TEST_FILE};
254-
fi
255-
"
256-
25757
lint:
258-
image: typo3/core-testing-${DOCKER_PHP_IMAGE}:latest
58+
image: ${DOCKER_PHP_IMAGE}
25959
user: "${HOST_UID}"
26060
volumes:
26161
- ${CORE_ROOT}:${CORE_ROOT}
@@ -272,7 +72,7 @@ services:
27272
"
27373
27474
phpstan:
275-
image: typo3/core-testing-${DOCKER_PHP_IMAGE}:latest
75+
image: ${DOCKER_PHP_IMAGE}
27676
user: "${HOST_UID}"
27777
volumes:
27878
- ${CORE_ROOT}:${CORE_ROOT}
@@ -288,30 +88,3 @@ services:
28888
php -v | grep '^PHP';
28989
php -dxdebug.mode=off .Build/bin/phpstan analyze -c Build/phpstan.neon --no-progress --no-interaction
29090
"
291-
292-
unit:
293-
image: typo3/core-testing-${DOCKER_PHP_IMAGE}:latest
294-
user: "${HOST_UID}"
295-
volumes:
296-
- ${CORE_ROOT}:${CORE_ROOT}
297-
- ${HOST_HOME}:${HOST_HOME}
298-
- /etc/passwd:/etc/passwd:ro
299-
- /etc/group:/etc/group:ro
300-
working_dir: ${CORE_ROOT}/.Build
301-
command: >
302-
/bin/sh -c "
303-
if [ ${SCRIPT_VERBOSE} -eq 1 ]; then
304-
set -x
305-
fi
306-
php -v | grep '^PHP';
307-
if [ ${PHP_XDEBUG_ON} -eq 0 ]; then
308-
XDEBUG_MODE=\"off\" \
309-
bin/phpunit -c Web/typo3conf/ext/form_custom_templates/Build/UnitTests.xml ${EXTRA_TEST_OPTIONS} ${TEST_FILE};
310-
else
311-
DOCKER_HOST=`route -n | awk '/^0.0.0.0/ { print $$2 }'`
312-
XDEBUG_MODE=\"debug,develop\" \
313-
XDEBUG_TRIGGER=\"foo\" \
314-
XDEBUG_CONFIG=\"client_port=${PHP_XDEBUG_PORT} client_host=$${DOCKER_HOST}\" \
315-
bin/phpunit -c Web/typo3conf/ext/form_custom_templates/Build/UnitTests.xml ${EXTRA_TEST_OPTIONS} ${TEST_FILE};
316-
fi
317-
"

0 commit comments

Comments
 (0)