Skip to content

Commit

Permalink
[TASK] Refactor complete controller
Browse files Browse the repository at this point in the history
  • Loading branch information
calien666 committed Nov 10, 2024
1 parent 1a1a251 commit 72389db
Show file tree
Hide file tree
Showing 43 changed files with 1,509 additions and 954 deletions.
7 changes: 3 additions & 4 deletions .ddev/config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: xlsexport
type: typo3
docroot: public
php_version: "8.1"
docroot: .Build/Web
php_version: "8.2"
webserver_type: nginx-fpm
router_http_port: "80"
router_https_port: "443"
Expand All @@ -11,8 +11,7 @@ additional_fqdns: []
database:
type: mariadb
version: "10.3"
nfs_mount_enabled: false
mutagen_enabled: false
performance_mode: none
use_dns_when_possible: true
composer_version: "2"
web_environment:
Expand Down
143 changes: 143 additions & 0 deletions .github/workflows/testcore12.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
name: tests core 12

on:
pull_request:
workflow_dispatch:

jobs:
code-quality:
name: "code quality with core v12"
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
php-version: [ '8.1']
permissions:
# actions: read|write|none
actions: none
# checks: read|write|none
checks: none
# contents: read|write|none
contents: read
# deployments: read|write|none
deployments: none
# id-token: read|write|none
id-token: none
# issues: read|write|none
issues: none
# discussions: read|write|none
discussions: none
# packages: read|write|none
packages: read
# pages: read|write|none
pages: none
# pull-requests: read|write|none
pull-requests: none
# repository-projects: read|write|none
repository-projects: read
# security-events: read|write|none
security-events: none
# statuses: read|write|none
statuses: none
steps:
- name: "Checkout"
uses: actions/checkout@v4

- name: "Prepare dependencies for TYPO3 v12"
run: "Build/Scripts/runTests.sh -t 12 -p ${{ matrix.php-version }} -s composer require typo3/cms-core:^12.4 -W"

# Disabled, as latest installable version of TypoScript linter does not support the TYPO3 backend layout
# override syntax in PageTSConfig files.
# @see https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.0/Feature-96812-OverrideBackendTemplatesWithTSconfig.html
# - name: "Run TypoScript lint"
# run: "Build/Scripts/runTests.sh -t 12 -p ${{ matrix.php-version }} -s lintTypoScript"

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

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

- name: "Ensure tests methods do not start with \"test\""
run: "Build/Scripts/runTests.sh -t 12 -p ${{ matrix.php-version }} -s checkTestMethodsPrefix"

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

# Disabled until documentation is added
# - name: "Test .rst files for integrity"
# run: "Build/Scripts/runTests.sh -t 12 -p ${{ matrix.php-version }} -s checkRst"

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

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


testsuite:
name: all tests with core v12
runs-on: ubuntu-22.04
needs:
- code-quality
strategy:
fail-fast: false
matrix:
php-version: [ '8.1', '8.2', '8.3', '8.4' ]
permissions:
# actions: read|write|none
actions: none
# checks: read|write|none
checks: none
# contents: read|write|none
contents: read
# deployments: read|write|none
deployments: none
# id-token: read|write|none
id-token: none
# issues: read|write|none
issues: none
# discussions: read|write|none
discussions: none
# packages: read|write|none
packages: read
# pages: read|write|none
pages: none
# pull-requests: read|write|none
pull-requests: none
# repository-projects: read|write|none
repository-projects: read
# security-events: read|write|none
security-events: none
# statuses: read|write|none
statuses: none
steps:
- name: "Checkout"
uses: actions/checkout@v4

- name: "Prepare dependencies for TYPO3 v12"
run: "Build/Scripts/runTests.sh -t 12 -p ${{ matrix.php-version }} -s composer require typo3/cms-core:^12.4 -W"

- name: "Unit"
run: "Build/Scripts/runTests.sh -t 12 -p ${{ matrix.php-version }} -s unit"

- name: "Functional SQLite"
run: "Build/Scripts/runTests.sh -t 12 -p ${{ matrix.php-version }} -s functional -d sqlite"

- name: "Functional MariaDB 10.5 mysqli"
run: "Build/Scripts/runTests.sh -t 12 -p ${{ matrix.php-version }} -s functional -d mariadb -a mysqli"

- name: "Functional MariaDB 10.5 pdo_mysql"
run: "Build/Scripts/runTests.sh -t 12 -p ${{ matrix.php-version }} -s functional -d mariadb -a pdo_mysql"

- name: "Functional MySQL 8.0 mysqli"
run: "Build/Scripts/runTests.sh -t 12 -p ${{ matrix.php-version }} -s functional -d mariadb -a mysqli"

- name: "Functional MySQL 8.0 pdo_mysql"
run: "Build/Scripts/runTests.sh -t 12 -p ${{ matrix.php-version }} -s functional -d mariadb -a pdo_mysql"

- name: "Functional PostgresSQL 10"
# v12 postgres functional disabled with PHP 8.2 since https://github.com/doctrine/dbal/commit/73eec6d882b99e1e2d2d937accca89c1bd91b2d7
# is not fixed in doctrine core v12 doctrine 2.13.9
if: ${{ matrix.php <= '8.1' }}
run: "Build/Scripts/runTests.sh -t 12 -p ${{ matrix.php-version }} -s functional -d postgres"
139 changes: 139 additions & 0 deletions .github/workflows/testcore13.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
name: tests core 13

on:
pull_request:
workflow_dispatch:

jobs:
code-quality:
name: "code quality with core v13"
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
php-version: [ '8.2' ]
permissions:
# actions: read|write|none
actions: none
# checks: read|write|none
checks: none
# contents: read|write|none
contents: read
# deployments: read|write|none
deployments: none
# id-token: read|write|none
id-token: none
# issues: read|write|none
issues: none
# discussions: read|write|none
discussions: none
# packages: read|write|none
packages: read
# pages: read|write|none
pages: none
# pull-requests: read|write|none
pull-requests: none
# repository-projects: read|write|none
repository-projects: read
# security-events: read|write|none
security-events: none
# statuses: read|write|none
statuses: none
steps:
- name: "Checkout"
uses: actions/checkout@v4

- name: "Prepare dependencies for TYPO3 v13"
run: "Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php-version }} -s composer require typo3/cms-core:^13.4 -W"

# Disabled, as latest installable version of TypoScript linter does not support the TYPO3 backend layout
# override syntax in PageTSConfig files.
# @see https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/13.0/Feature-96813-OverrideBackendTemplatesWithTSconfig.html
# - name: "Run TypoScript lint"
# run: "Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php-version }} -s lintTypoScript"

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

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

- name: "Ensure tests methods do not start with \"test\""
run: "Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php-version }} -s checkTestMethodsPrefix"

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

# Deactivated until documentation is written
# - name: "Test .rst files for integrity"
# run: "Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php-version }} -s checkRst"

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

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

testsuite:
name: all tests with core v13
runs-on: ubuntu-22.04
needs:
- code-quality
strategy:
fail-fast: false
matrix:
php-version: [ '8.2', '8.3', '8.4' ]
permissions:
# actions: read|write|none
actions: none
# checks: read|write|none
checks: none
# contents: read|write|none
contents: read
# deployments: read|write|none
deployments: none
# id-token: read|write|none
id-token: none
# issues: read|write|none
issues: none
# discussions: read|write|none
discussions: none
# packages: read|write|none
packages: read
# pages: read|write|none
pages: none
# pull-requests: read|write|none
pull-requests: none
# repository-projects: read|write|none
repository-projects: read
# security-events: read|write|none
security-events: none
# statuses: read|write|none
statuses: none
steps:
- name: "Checkout"
uses: actions/checkout@v4

- name: "Prepare dependencies for TYPO3 v13"
run: "Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php-version }} -s composer require typo3/cms-core:^13.4 -W"

- name: "Unit"
run: "Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php-version }} -s unit"

- name: "Functional SQLite"
run: "Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php-version }} -s functional -d sqlite"

- name: "Functional MariaDB 10.5 mysqli"
run: "Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php-version }} -s functional -d mariadb -a mysqli"

- name: "Functional MariaDB 10.5 pdo_mysql"
run: "Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php-version }} -s functional -d mariadb -a pdo_mysql"

- name: "Functional MySQL 8.0 mysqli"
run: "Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php-version }} -s functional -d mariadb -a mysqli"

- name: "Functional MySQL 8.0 pdo_mysql"
run: "Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php-version }} -s functional -d mariadb -a pdo_mysql"

- name: "Functional PostgresSQL 10"
run: "Build/Scripts/runTests.sh -t 13 -p ${{ matrix.php-version }} -s functional -d postgres"
4 changes: 2 additions & 2 deletions Build/Scripts/runTests.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

#
# lavitto/typo3-form-to-database test runner based on docker/podman.
# calien-typo3-xlseport test runner based on docker/podman.
#
if [ "${CI}" != "true" ]; then
trap 'echo "runTests.sh SIGINT signal emitted";cleanUp;exit 2' SIGINT
Expand Down Expand Up @@ -444,7 +444,7 @@ echo "Architecture" ${ARCH} "requires" ${IMAGE_SELENIUM} "to run acceptance test
shift $((OPTIND - 1))

SUFFIX=$(echo $RANDOM)
NETWORK="lavitto-form-to-database-${SUFFIX}"
NETWORK="calien-typo3-xlseport-${SUFFIX}"
${CONTAINER_BIN} network create ${NETWORK} >/dev/null

if [ "${CONTAINER_BIN}" == "docker" ]; then
Expand Down
2 changes: 1 addition & 1 deletion Build/Scripts/testMethodPrefixChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function enterNode(Node $node): void
}
}

$parser = (new ParserFactory())->createForVersion(\PhpParser\PhpVersion::getHostVersion());
$parser = (new ParserFactory())->createForNewestSupportedVersion();

$finder = new Symfony\Component\Finder\Finder();
$finder->files()
Expand Down
Loading

0 comments on commit 72389db

Please sign in to comment.