mirror of https://github.com/FriendsOfTYPO3/tea.git synced 2024-11-22 06:16:12 +01:00
Mirror of TYPO3 Extension tea, managed by the Best Practice Team https://typo3.org/community/teams/best-practices
Find a file
Stefan Bürk 00ba733b0e
[FEATURE] Integrate runTests.sh execution wrapper - round one (#900)
TYPO3 Core and related repositories like the `typo3/testing-framework`
or `typo3/styleguide` uses a bash script arround docker to execute all
scripts over different operating systems in a controlled and ensured
manner. This helps to reproduce locally failing jobs from a CI like
GitHub actions or GitLab.

TYPO3 core dropped recently the requirement for `docker-compose`,
reducing it to `docker` and preparing for dual usage with docker
and podman in the future.

This change integrates the current state as extension wrapper,
aligning contained suits with existing tools. Additionally, a
TYPO3 core version switch is integrated.

The added script is excluded from git archive building and
during releasing.

A list of possible options can be display with:

```shell
Build/Scripts/runTests.sh -h
```

Overview of integrated features:

* `-p` to select the PHP version (7.4 - 8.3)
* `-s` to select the suite to execute
* `-t` to select the TYPO3 core version, mainly
  needed for the `composer` suits executions
* `-e` to provide additionally flags for phpunit
  executions, e.g. for unit and functional tests
* `-x` to enable xdebug trigger - this helps with
  debugging during unit or functional test
* `-d` to select the database backend to use, needed
  for functional test execution to start the correct
  database
* `-a` to select the used php driver for the `-d`
  database backend, if multiple options are possible
* `-i` to specify the mariadb version
* `-j` to specify the mysql version
* `-k` to specify the postgres version

Available suits (`-s`):

- cgl: Checks the code style with the PHP Coding Standards Fixer
  (PHP-CS-Fixer).
- cglFix: Fixes the code style with PHP-CS-Fixer."
- clean: clean up build, cache and testing related files and
  folders
- cleanBuild: clean up build related files and folders
- cleanCache: clean up cache related files and folders
- cleanRenderedDocumentation: clean up rendered documentation
  files and folders (Documentation-GENERATED-temp)
- cleanTests: clean up test related files and folders
- composer: "composer" with all remaining arguments dispatched.
- composerInstallMax: "composer update", with no platform.php config.
- composerInstallMin: "composer update --prefer-lowest", with
  platform.php set to PHP version x.x.0.
- docsGenerate: Renders the extension ReST documentation.
- functional: PHP functional tests
- lintTypoScript: TypoScript linting
- lintPhp: PHP linting
- lintJson: JSON linting
- lintYaml: YAML linting
- phpstan: phpstan tests
- phpstanGenerateBaseline: regenerate phpstan baseline, handy after
  phpstan updates
- unit (default): PHP unit tests
- unitRandom: PHP unit tests in random order, add -o <number> to use
  specific seed

Notes:

* Not everything is available directly for now in the `runTests.sh`
  and therefore not enabled in CI.

* Coverage related execution needs extended work and are therefore
  left out for now.

* `composer.json` protection for core version changes not included
  yet like the one or other advanced option.

* Intermediate cleanings for changing php versions and core versions
  not included yet and will follow.

* typo3/testing-framework template files **must** be copied to the
  extension or project and **must not** be used from the  vendor
  folder.

Resolves: #899
Releases: main
2023-07-31 13:38:07 +02:00
.ddev [TASK] Update PHP in DDEV to 8.1 (#561) 2022-09-07 11:54:24 +02:00
.github [TASK] Move Dependabot to target to 3.1.0 milestone for PRs (#890) 2023-07-11 11:05:58 +02:00
.gitlab [BUGFIX] Add missing PHP extensions in GitLab CI 2023-06-14 12:51:03 +02:00
Build/Scripts [FEATURE] Integrate runTests.sh execution wrapper - round one (#900) 2023-07-31 13:38:07 +02:00
Classes [TASK] Switch the TeaController to construtor injection (#881) 2023-07-03 14:26:21 +02:00
Configuration [FEATURE] Add a list view for the FE tea editor (#864) 2023-06-22 11:17:51 +00:00
Documentation [TASK] Remove phpcpd (PHP Copy/Paste Detector) (#800) 2023-04-06 16:26:51 +02:00
Resources [FEATURE] Add a delete functionality for the Tea FE editor (#876) 2023-06-23 11:55:19 +02:00
Tests [TASK] Switch the TeaController to construtor injection (#881) 2023-07-03 14:26:21 +02:00
tools [TASK] Remove phpcpd (PHP Copy/Paste Detector) (#800) 2023-04-06 16:26:51 +02:00
.editorconfig Change default rst indentation to 4 spaces (#508) 2022-08-20 13:59:53 +02:00
.eslintignore [TASK] Move npm tools and config to default places (#445) 2022-05-18 17:17:45 +02:00
.eslintrc.json [TASK] Improved ESLint config for Backend JavaScript (#476) 2022-07-08 12:43:19 +02:00
.gitattributes [FEATURE] Integrate runTests.sh execution wrapper - round one (#900) 2023-07-31 13:38:07 +02:00
.gitignore [FEATURE] Integrate runTests.sh execution wrapper - round one (#900) 2023-07-31 13:38:07 +02:00
.php-cs-fixer.php [TASK] Migrate to typo3 coding standards (#340) 2021-11-17 16:45:49 +01:00
.phpstorm.meta.php [BUGFIX] Add hidden files to find in PHP lint (#559) 2022-09-07 11:47:31 +02:00
.prettierrc.js [TASK] Move npm tools and config to default places (#445) 2022-05-18 17:17:45 +02:00
CHANGELOG.md [FEATURE] Add a delete functionality for the Tea FE editor (#876) 2023-06-23 11:55:19 +02:00
CODE_OF_CONDUCT.md [TASK] Switch to the TYPO3 Code of Conduct (#430) 2022-04-14 18:11:50 +02:00
composer.json [FEATURE] Integrate runTests.sh execution wrapper - round one (#900) 2023-07-31 13:38:07 +02:00
ext_emconf.php [FEATURE] Support PHP 8.2 (#787) 2023-04-02 12:53:33 +02:00
ext_localconf.php [FEATURE] Add a delete functionality for the Tea FE editor (#876) 2023-06-23 11:55:19 +02:00
ext_tables.sql [FEATURE] Add Tea.ownerUid (#860) 2023-06-21 09:16:13 +02:00
LICENSE [TASK] Change from GPL V3+ to GPL V2+ (#40) 2019-08-08 12:38:56 +02:00
package.json Update eslint requirement from ^8.44.0 to ^8.45.0 (#892) 2023-07-17 06:03:28 +00:00
phive.xml [TASK] Remove phpcpd (PHP Copy/Paste Detector) (#800) 2023-04-06 16:26:51 +02:00
phpcs.xml [TASK] Remove the ancient acceptance tests (#512) 2022-08-28 09:33:50 +02:00
phpstan-baseline.neon [BUGFIX] Do not overwrite type annotations from parent classes (#480) 2022-07-13 18:21:01 +02:00
phpstan.neon [TASK] Remove the ancient acceptance tests (#512) 2022-08-28 09:33:50 +02:00
README.md [FEATURE] Allow installations on TYPO3 12 (#652) 2022-10-19 09:06:36 +02:00
stylelint.config.js [TASK] Move npm tools and config to default places (#445) 2022-05-18 17:17:45 +02:00

Example TYPO3 extension for code quality checks and automated tests

TYPO3 V12 TYPO3 V11 License Total downloads GitHub CI status GitLab CI status Coverage Status

This TYPO3 extension, based on Extbase and Fluid, is an example of best practices in automated code checks, unit/functional/acceptance testing and continuous integration.

You can also use this extension to manage your collection of delicious teas.

URL
Repository: https://github.com/TYPO3-Documentation/tea
Read online: https://docs.typo3.org/p/ttn/tea/main/en-us/
TER: https://extensions.typo3.org/extension/tea/
Slack: https://typo3.slack.com/channels/qa-best-practices

Presentation at the TYPO3 Online Days 2021

At the TYPO3 Online Days 2021, Oliver Klee held a session where her presented our approach for automating the code quality of extensions.

Slides

cover slide

Video recording

video still