From 1bbf12c46506633b1b65aaf2e19b8393a933c4fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Thu, 4 Sep 2025 17:47:40 +0200 Subject: [PATCH] feat(tests): Fail on PHPUnit warnings and risky tests, show deprecations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- autotest.sh | 4 ++-- composer.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/autotest.sh b/autotest.sh index 32a844a670d..7a02371390f 100755 --- a/autotest.sh +++ b/autotest.sh @@ -396,8 +396,8 @@ function execute_tests { echo "No coverage" fi - echo "$PHPUNIT" --colors=always --configuration phpunit-autotest.xml $GROUP $COVER --log-junit "autotest-results-$DB.xml" "$2" "$3" - "$PHPUNIT" --colors=always --configuration phpunit-autotest.xml $GROUP $COVER --log-junit "autotest-results-$DB.xml" "$2" "$3" + echo "$PHPUNIT" --fail-on-warning --fail-on-risky --display-deprecations --display-phpunit-deprecations --colors=always --configuration phpunit-autotest.xml $GROUP $COVER --log-junit "autotest-results-$DB.xml" "$2" "$3" + "$PHPUNIT" --fail-on-warning --fail-on-risky --display-deprecations --display-phpunit-deprecations --colors=always --configuration phpunit-autotest.xml $GROUP $COVER --log-junit "autotest-results-$DB.xml" "$2" "$3" RESULT=$? if [ "$PRIMARY_STORAGE_CONFIG" == "swift" ] ; then diff --git a/composer.json b/composer.json index e338201631d..1f89ba949d1 100644 --- a/composer.json +++ b/composer.json @@ -68,9 +68,9 @@ "Composer\\Config::disableProcessTimeout", "PHP_CLI_SERVER_WORKERS=${NEXTCLOUD_WORKERS:=4} php -S ${NEXTCLOUD_HOST:=localhost}:${NEXTCLOUD_PORT:=8080} -t ./" ], - "test": "phpunit --colors=always --configuration tests/phpunit-autotest.xml", + "test": "phpunit --fail-on-warning --fail-on-risky --display-warnings --display-deprecations --display-phpunit-deprecations --colors=always --configuration tests/phpunit-autotest.xml", "test:db": "@composer run test -- --group DB,SLOWDB", - "test:files_external": "phpunit --colors=always --configuration tests/phpunit-autotest-external.xml", + "test:files_external": "phpunit --fail-on-warning --fail-on-risky --display-warnings --display-deprecations --display-phpunit-deprecations --colors=always --configuration tests/phpunit-autotest-external.xml", "rector": "rector --config=build/rector.php && composer cs:fix", "openapi": "./build/openapi-checker.sh" },