Commit 93b7e7b0 authored by Stefan Bürk's avatar Stefan Bürk
Browse files

[TASK] Add runTest.sh -s clean to remove build related files

Add script to 'Build/Scripts/runTests.sh' to clean build and
test related files and folders to get fast a clean state.
Local instance related files are untouched and kept intact.

Added commands:

> Build/Scripts/runTests.sh -s clean
> Build/Scripts/runTests.sh -s cleanBuild
> Build/Scripts/runTests.sh -s cleanCache
> Build/Scripts/runTests.sh -s cleanTests

Resolves: #97355
Releases: main, 11.5, 10.4
Change-Id: I05c9dd966f4703315474e369dad52b1a40881c60
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74267


Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Tested-by: Nikita Hovratov's avatarNikita Hovratov <nikita.h@live.de>
Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Nikita Hovratov's avatarNikita Hovratov <nikita.h@live.de>
Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
parent 89c74eca
......@@ -63,6 +63,45 @@ handleDbmsAndDriverOptions() {
esac
}
cleanBuildFiles() {
# > builds
echo -n "Clean builds ... " ; rm -rf \
../../../Build/JavaScript \
../../../Build/node_modules ; \
echo "done"
}
cleanCacheFiles() {
# > caches
echo -n "Clean caches ... " ; rm -rf \
../../../.cache \
../../../Build/.cache \
../../../Build/composer/.cache/ \
../../../.php-cs-fixer.cache ; \
echo "done"
}
cleanTestFiles() {
# > composer distribution test
echo -n "Clean composer distribution test ... " ; rm -rf \
../../../Build/composer/composer.json \
../../../Build/composer/composer.lock \
../../../Build/composer/public/index.php \
../../../Build/composer/public/typo3 \
../../../Build/composer/public/typo3conf/ext \
../../../Build/composer/var/ \
../../../Build/composer/vendor/ ; \
echo "done"
# > test related
echo -n "Clean test related files ... " ; rm -rf \
../../../Build/phpunit/FunctionalTests-Job-*.xml \
../../../typo3/sysext/core/Tests/Acceptance/AcceptanceTests-Job-* \
../../../typo3/sysext/core/Tests/Acceptance/Support/_generated \
../../../typo3temp/var/tests/ ; \
echo "done"
}
# Load help text into $HELP
read -r -d '' HELP <<EOF
TYPO3 core test runner. Execute acceptance, unit, functional and other test suites in
......@@ -96,6 +135,10 @@ Options:
- checkPermissions: test some core files for correct executable bits
- checkRst: test .rst files for integrity
- checkTestMethodsPrefix: check tests methods do not start with "test"
- 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
- cleanTests: clean up test related files and folders
- 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.
......@@ -560,6 +603,20 @@ case ${TEST_SUITE} in
SUITE_EXIT_CODE=$?
docker-compose down
;;
clean)
cleanBuildFiles
cleanCacheFiles
cleanTestFiles
;;
cleanBuild)
cleanBuildFiles
;;
cleanCache)
cleanCacheFiles
;;
cleanTests)
cleanTestFiles
;;
composerInstall)
setUpDockerComposeDotEnv
docker-compose run composer_install
......
Supports Markdown
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