Skip to content
Snippets Groups Projects
Commit f99e80b5 authored by Stefan Bürk's avatar Stefan Bürk
Browse files

[TASK] Add `composer` dispatcher to `runTests.sh`

This change adds a composer command dispatcher to
`Build/Scripts/runTests.sh` to allow the execution
of any composer command without the hassle to have
a proper composer installed on the host system.

This also helps for onboarding new contributors not
having a proper php and composer ecosystem installed
on the host system.

For example, to raise dependencies following can now
be used:

> Build/Scripts/runTests.sh -s composer -- require --dev \
  typo3/testing-framework:dev-main

Other examples:

> Build/Scripts/runTests.sh -s composer -- dumpautoload
> Build/Scripts/runTests.sh -s composer -- info | grep "symfony"

Resolves: #103045
Releases: main, 12.4, 11.5
Change-Id: I65fa14e2c8d0d1a1204b3bed701d8c3458b6e3bb
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82838


Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
parent 9a6f1227
Branches
Tags
No related merge requests found
......@@ -203,6 +203,7 @@ Options:
- 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" command dispatcher, to execute various composer commands
- composerInstall: "composer install"
- composerInstallMax: "composer update", with no platform.php config.
- composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0.
......@@ -356,6 +357,13 @@ Examples:
# Run installer tests of a new instance on sqlite
./Build/Scripts/runTests.sh -s acceptanceInstall -d sqlite
# Run composer require to require a dependency
./Build/Scripts/runTests.sh -s composer -- require --dev typo3/testing-framework:dev-main
# Some composer command examples
./Build/Scripts/runTests.sh -s composer -- dumpautoload
./Build/Scripts/runTests.sh -s composer -- info | grep "symfony"
EOF
}
......@@ -815,6 +823,11 @@ case ${TEST_SUITE} in
cleanTests)
cleanTestFiles
;;
composer)
COMMAND=(composer "$@")
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} "${COMMAND[@]}"
SUITE_EXIT_CODE=$?
;;
composerInstall)
${CONTAINER_BIN} run ${CONTAINER_COMMON_PARAMS} --name composer-install-${SUFFIX} -e COMPOSER_CACHE_DIR=.cache/composer -e COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION} ${IMAGE_PHP} composer install --no-progress --no-interaction
SUITE_EXIT_CODE=$?
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment