Skip to content
Merged

V3.1 #16

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ jobs:

tests:
name: All tests
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
strategy:
matrix:
php: [ '8.2']
php: [ '8.2', '8.5']
TYPO3: [ '13', '14' ]
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v6

- name: Install testing system
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -t ${{ matrix.TYPO3 }} -s composerUpdate
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -t ${{ matrix.TYPO3 }} -s composerInstall

- name: Composer validate
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -s composerValidate
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
public
composer.lock
vendor
var
.php_cs.cache
.php-cs-fixer.cache
/.Build
Expand Down
61 changes: 4 additions & 57 deletions Build/Scripts/runTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,43 +49,20 @@ No arguments: Run all unit tests with PHP 8.0
Options:
-s <...>
Specifies which test suite to run
- acceptance: backend acceptance tests
- cgl: cgl test and fix all php files
- composerUpdate: "composer update", handy if host has no PHP
- composerValidate: "composer validate"
- functional: functional tests
- lint: PHP linting
- phpstan: phpstan analyze
- unit (default): PHP unit tests

-t <13|14>
Only with -s composerUpdate|acceptance|functional
TYPO3 core major version the extension is embedded in for testing.

-d <mariadb|postgres|sqlite>
Only with -s functional
Specifies on which DBMS tests are performed
- mariadb (default): use mariadb
- postgres: use postgres
- sqlite: use sqlite

-p <8.2|8.3|8.4|8.5>
Specifies the PHP minor version to be used
- 8.2 (default): use PHP 8.2

-e "<phpunit or codeception options>"
Only with -s acceptance|functional|unit
Additional options to send to phpunit (unit & functional tests) or codeception (acceptance
tests). For phpunit, options starting with "--" must be added after options starting with "-".
Example -e "-v --filter canRetrieveValueWithGP" to enable verbose output AND filter tests
named "canRetrieveValueWithGP"

-x
Only with -s functional|unit|acceptance
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.
Expand Down Expand Up @@ -139,7 +116,7 @@ PHP_XDEBUG_PORT=9003
EXTRA_TEST_OPTIONS=""
SCRIPT_VERBOSE=0
CGLCHECK_DRY_RUN=""
TYPO3="13"
TYPO3="14"

# Option parsing
# Reset in case getopts has been used previously in the shell
Expand Down Expand Up @@ -207,7 +184,7 @@ if [ ${#INVALID_OPTIONS[@]} -ne 0 ]; then
fi

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

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

# Suite execution
case ${TEST_SUITE} in
acceptance)
setUpDockerComposeDotEnv
docker compose run acceptance_backend_mariadb10
SUITE_EXIT_CODE=$?
docker compose down
;;
cgl)
# Active dry-run for cgl needs not "-n" but specific options
if [ -n "${CGLCHECK_DRY_RUN}" ]; then
Expand All @@ -238,9 +209,9 @@ case ${TEST_SUITE} in
SUITE_EXIT_CODE=$?
docker compose down
;;
composerUpdate)
composerInstall)
setUpDockerComposeDotEnv
docker compose run composer_update
docker compose run composer_install
SUITE_EXIT_CODE=$?
docker compose down
;;
Expand All @@ -250,30 +221,6 @@ case ${TEST_SUITE} in
SUITE_EXIT_CODE=$?
docker compose down
;;
functional)
setUpDockerComposeDotEnv
case ${DBMS} in
mariadb)
docker compose run functional_mariadb10
SUITE_EXIT_CODE=$?
;;
postgres)
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
SUITE_EXIT_CODE=$?
;;
*)
echo "Invalid -d option argument ${DBMS}" >&2
echo >&2
echo "${HELP}" >&2
exit 1
esac
docker compose down
;;
lint)
setUpDockerComposeDotEnv
docker compose run lint
Expand Down
10 changes: 8 additions & 2 deletions Build/php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<?php

$config = \TYPO3\CodingStandards\CsFixerConfig::create();
$config->getFinder()->in(['Classes', 'Configuration']);
$config->getFinder()->exclude(['var', 'public']);
$config->getFinder()->exclude(['var', 'public', 'Build'])->in(__DIR__ . '/..');
$config->addRules([
'nullable_type_declaration' => [
'syntax' => 'question_mark',
],
'nullable_type_declaration_for_default_null_value' => true,
'declare_strict_types' => true,
]);
return $config;
2 changes: 0 additions & 2 deletions Build/phpstan-baseline.neon

This file was deleted.

3 changes: 0 additions & 3 deletions Build/phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
includes:
- ../.Build/vendor/phpstan/phpstan/conf/bleedingEdge.neon
- ./phpstan-baseline.neon
parameters:
level: 5

Expand Down
Loading