Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test environment for TYPO3 v10 #11

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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: 8 additions & 0 deletions .ddev/commands/web/update-to
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

## Description: Local TYPO3 version switcher
## Usage: update-to {11}
## Example: "ddev update-to 11"
## ProjectTypes: typo3

bash ./Build/Scripts/composer-for-core-version.sh $*
2 changes: 1 addition & 1 deletion .ddev/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ type: typo3
docroot: .Build/Web
# Using 8.1 instead of 8.0 to use helhum/typo3-console 8.
# Version 7 throws an error during install:setup script.
php_version: "8.1"
php_version: "7.4"
webserver_type: nginx-fpm
router_http_port: "80"
router_https_port: "443"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
name: tests core 11
name: tests core 10

on:
pull_request:

jobs:
code-quality:
name: "code quality with core v11"
name: "code quality with core v10"
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
php-version: [ '8.1']
php-version: [ '7.4']
steps:
- name: "Checkout"
uses: actions/checkout@v3

- name: "Prepare dependencies for TYPO3 v11"
run: "Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php-version }} -s composerUpdate"
- name: "Prepare dependencies for TYPO3 v10"
run: "Build/Scripts/runTests.sh -t 10 -p ${{ matrix.php-version }} -s composerUpdate"

- name: "Run TypoScript lint"
run: "Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php-version }} -s lintTypoScript"
run: "Build/Scripts/runTests.sh -t 10 -p ${{ matrix.php-version }} -s lintTypoScript"

- name: "Run PHP lint"
run: "Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php-version }} -s lintPhp"
run: "Build/Scripts/runTests.sh -t 10 -p ${{ matrix.php-version }} -s lintPhp"

- name: "Validate CGL"
run: "Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php-version }} -s cgl"
run: "Build/Scripts/runTests.sh -t 10 -p ${{ matrix.php-version }} -s cgl"

- name: "Ensure UTF-8 files do not contain BOM"
run: "Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php-version }} -s checkBom"
run: "Build/Scripts/runTests.sh -t 10 -p ${{ matrix.php-version }} -s checkBom"

- name: "Test .rst files for integrity"
run: "Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php-version }} -s checkRst"
run: "Build/Scripts/runTests.sh -t 10 -p ${{ matrix.php-version }} -s checkRst"

- name: "Find duplicate exception codes"
run: "Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php-version }} -s checkExceptionCodes"
run: "Build/Scripts/runTests.sh -t 10 -p ${{ matrix.php-version }} -s checkExceptionCodes"

- name: "Run PHPStan"
run: "Build/Scripts/runTests.sh -t 11 -p ${{ matrix.php-version }} -s phpstan"
run: "Build/Scripts/runTests.sh -t 10 -p ${{ matrix.php-version }} -s phpstan"

# testsuite:
# name: all tests with core v11
Expand Down
17 changes: 16 additions & 1 deletion Build/Scripts/composer-for-core-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ update_v11() {
"phpunit/phpunit":"^9.6.8"
}

update_v10() {
echo -e "💪 Enforce TYPO3 v10"
composer require --no-update \
"typo3/cms-core":"^10.4"

echo -e "💪 Enforce PHPUnit ^9.5.25"
composer req --dev --no-update \
"phpunit/phpunit":"^9.5.25"
}

case "$1" in
12)
composer_cleanup
Expand All @@ -51,8 +61,13 @@ case "$1" in
update_v11
composer_update
;;
10)
composer_cleanup
update_v10
composer_update
;;
*)
echo -e "🌀 Usage: ddev update-to (11|12)" >&2
echo -e "🌀 Usage: ddev update-to (10|11|12)" >&2
exit 0
;;
esac
22 changes: 13 additions & 9 deletions Build/Scripts/runTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,11 @@ Options:
- 8.1: use PHP 8.1
- 8.2: use PHP 8.2

-t <11|12>
-t <10|11|12>
Only with -s composerUpdate
Specifies the TYPO3 core major version to be used
- 11 (default): use TYPO3 core v11
- 10 (default): use TYPO3 core v10
- 11: use TYPO3 core v11
- 12: use TYPO3 core v12

-e "<phpunit or codeception options>"
Expand Down Expand Up @@ -192,7 +193,7 @@ fi
TEST_SUITE=""
DBMS="sqlite"
PHP_VERSION="7.4"
TYPO3_VERSION="11"
TYPO3_VERSION="10"
PHP_XDEBUG_ON=0
EXTRA_TEST_OPTIONS=""
SCRIPT_VERBOSE=0
Expand Down Expand Up @@ -225,7 +226,7 @@ while getopts ":s:a:d:p:t:e:xnhuv" OPT; do
;;
t)
TYPO3_VERSION=${OPTARG}
if ! [[ ${TYPO3_VERSION} =~ ^(11|12)$ ]]; then
if ! [[ ${TYPO3_VERSION} =~ ^(10|11|12)$ ]]; then
INVALID_OPTIONS+=("p ${OPTARG}")
fi
;;
Expand Down Expand Up @@ -347,7 +348,7 @@ case ${TEST_SUITE} in
case ${DBMS} in
mariadb)
echo "Using driver: ${DATABASE_DRIVER}"
if [[ "${TYPO3_VERSION}" -eq 11 ]] ; then
if [[ "${TYPO3_VERSION}" -eq 10 || "${TYPO3_VERSION}" -eq 11 ]] ; then
docker-compose run functional_mariadb10
SUITE_EXIT_CODE=$?
else
Expand All @@ -357,7 +358,7 @@ case ${TEST_SUITE} in
;;
mysql)
echo "Using driver: ${DATABASE_DRIVER}"
if [[ "${TYPO3_VERSION}" -eq 11 ]] ; then
if [[ "${TYPO3_VERSION}" -eq 10 || "${TYPO3_VERSION}" -eq 11 ]] ; then
docker-compose run functional_mysql80
SUITE_EXIT_CODE=$?
else
Expand All @@ -366,7 +367,7 @@ case ${TEST_SUITE} in
fi
;;
postgres)
if [[ "${TYPO3_VERSION}" -eq 11 ]] ; then
if [[ "${TYPO3_VERSION}" -eq 10 || "${TYPO3_VERSION}" -eq 11 ]] ; then
docker-compose run functional_postgres10
SUITE_EXIT_CODE=$?
else
Expand All @@ -380,9 +381,12 @@ case ${TEST_SUITE} in
# root if docker creates it. Thank you, docker. We create the path beforehand
# to avoid permission issues.
mkdir -p ${ROOT_DIR}/.Build/Web/typo3temp/var/tests/functional-sqlite-dbs/
if [[ "${TYPO3_VERSION}" -eq 11 ]] ; then
if [[ "${TYPO3_VERSION}" -eq 10 ]] ; then
docker-compose run functional_sqlite
SUITE_EXIT_CODE=$?
elif [[ "${TYPO3_VERSION}" -eq 11 ]] ; then
docker-compose run functional_sqlite_phpunit9
SUITE_EXIT_CODE=$?
else
docker-compose run functional_sqlite_phpunit10
SUITE_EXIT_CODE=$?
Expand Down Expand Up @@ -429,7 +433,7 @@ case ${TEST_SUITE} in
;;
unit)
setUpDockerComposeDotEnv
if [[ "${TYPO3_VERSION}" -eq 11 ]] ; then
if [[ "${TYPO3_VERSION}" -eq 10 || "${TYPO3_VERSION}" -eq 11 ]] ; then
docker-compose run unit
SUITE_EXIT_CODE=$?
else
Expand Down
6 changes: 6 additions & 0 deletions Build/phpstan/Core10/phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
parameters:
ignoreErrors:
-
message: "#^Variable \\$_EXTKEY might not be defined\\.$#"
count: 1
path: ../../../ext_emconf.php
17 changes: 17 additions & 0 deletions Build/phpstan/Core10/phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
includes:
- ../../../.Build/vendor/saschaegerer/phpstan-typo3/extension.neon
- phpstan-baseline.neon

parameters:
# Use local .cache dir instead of /tmp
tmpDir: ../../../.cache/phpstan

level: 8

paths:
- ../../../

excludePaths:
- ../../../.Build
- ../../../.cache
- ../../../Build
3 changes: 2 additions & 1 deletion Build/phpstan/Core11/phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ parameters:
level: 8

paths:
- ../../../
- ../../../Classes
- ../../../Tests/

excludePaths:
- ../../../.Build
Expand Down
2 changes: 0 additions & 2 deletions Build/phpstan/Core12/phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,3 @@ parameters:

excludePaths:
- ../../../.Build
- ../../../Tests/Functional/Updates/Fixtures/Extension/test_extension/ext_emconf.php
- ../../../Classes/Override/Core11
2 changes: 1 addition & 1 deletion Build/phpunit/FunctionalTests-10.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<const name="TYPO3_MODE" value="BE"/>
<!--
@deprecated: Set this to not suppress warnings, notices and deprecations in functional tests
with TYPO3 core v11 and up.
with TYPO3 core 12 and up.
Will always be done with next major version.
To still suppress warnings, notices and deprecations, do NOT define the constant at all.
-->
Expand Down
67 changes: 34 additions & 33 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,43 +20,44 @@
{ "type": "git", "url": "https://github.com/andreaswolf/typo3-ext-migrations.git" }
],
"require": {
"php": "^8.1",
"typo3/cms-core": "^11.5",
"typo3/cms-rte-ckeditor": "^11.5"
"php": "^7.4",
"typo3/cms-core": "^10.4",
"typo3/cms-rte-ckeditor": "^10.4"
},
"require-dev": {
"typo3/cms-adminpanel": "^11.5",
"typo3/cms-backend": "^11.5",
"typo3/cms-belog": "^11.5",
"typo3/cms-beuser": "^11.5",
"typo3/cms-dashboard": "^11.5",
"typo3/cms-extbase": "^11.5",
"typo3/cms-extensionmanager": "^11.5",
"typo3/cms-felogin": "^11.5",
"typo3/cms-filelist": "^11.5",
"typo3/cms-filemetadata": "^11.5",
"typo3/cms-fluid": "^11.5",
"typo3/cms-fluid-styled-content": "^11.5",
"typo3/cms-form": "^11.5",
"typo3/cms-frontend": "^11.5",
"typo3/cms-impexp": "^11.5",
"typo3/cms-indexed-search": "^11.5",
"typo3/cms-info": "^11.5",
"typo3/cms-install": "^11.5",
"typo3/cms-linkvalidator": "^11.5",
"typo3/cms-lowlevel": "^11.5",
"typo3/cms-seo": "^11.5",
"typo3/cms-setup": "^11.5",
"typo3/cms-tstemplate": "^11.5",
"typo3/minimal": "^11",
"typo3/cms-composer-installers": "v4.0.0-RC1",
"helhum/typo3-console": "^7.1 || ^8.0",
"saschaegerer/phpstan-typo3": "^1.8",
"friendsofphp/php-cs-fixer": "^3.14",
"bk2k/bootstrap-package": "^14.0",
"typo3/cms-adminpanel": "^10.4",
"typo3/cms-backend": "^10.4",
"typo3/cms-belog": "^10.4",
"typo3/cms-beuser": "^10.4",
"typo3/cms-dashboard": "^10.4",
"typo3/cms-extbase": "^10.4",
"typo3/cms-extensionmanager": "^10.4",
"typo3/cms-felogin": "^10.4",
"typo3/cms-filelist": "^10.4",
"typo3/cms-filemetadata": "^10.4",
"typo3/cms-fluid": "^10.4",
"typo3/cms-fluid-styled-content": "^10.4",
"typo3/cms-form": "^10.4",
"typo3/cms-frontend": "^10.4",
"typo3/cms-impexp": "^10.4",
"typo3/cms-indexed-search": "^10.4",
"typo3/cms-info": "^10.4",
"typo3/cms-install": "^10.4",
"typo3/cms-linkvalidator": "^10.4",
"typo3/cms-lowlevel": "^10.4",
"typo3/cms-seo": "^10.4",
"typo3/cms-setup": "^10.4",
"typo3/cms-tstemplate": "^10.4",
"typo3/minimal": "^10",
"typo3/cms-composer-installers": "^3.1 || ^5.0",
"helhum/typo3-console": "^6.7 || ^7.1 || ^8.0",
"saschaegerer/phpstan-typo3": "^1.10",
"friendsofphp/php-cs-fixer": "^3.59",
"bk2k/bootstrap-package": "^12.0 || ^14.0",
"kaystrobach/migrations": "0.11.0",
"andreaswolf/typo3-uuid": "^0.3.0",
"cweagans/composer-patches": "^1.7"
"cweagans/composer-patches": "^1.7",
"phpunit/phpunit": "^9.5.25 || ^9.6.8 || ^10.1"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
'description' => 'The Academic Jobs extension allows users to create and manage job postings.',
'constraints' => [
'depends' => [
'typo3' => '11.5.0-12.4.99',
'typo3' => '10.4.0-12.4.99',
],
],
'state' => 'beta',
Expand Down
Loading