From 2d632b5e5bcfbd49bf3355c51be8269eff938242 Mon Sep 17 00:00:00 2001 From: Viktor Scharf Date: Fri, 17 Jan 2025 16:43:09 +0100 Subject: [PATCH] php-setup-and-run-all-tests --- .../bootstrap/WebDavPropertiesContext.php | 4 +- tests/acceptance/run_all_tests.sh | 68 +++++++++++++++++++ 2 files changed, 70 insertions(+), 2 deletions(-) create mode 100755 tests/acceptance/run_all_tests.sh diff --git a/tests/acceptance/bootstrap/WebDavPropertiesContext.php b/tests/acceptance/bootstrap/WebDavPropertiesContext.php index ac369e3642..5927de7e23 100644 --- a/tests/acceptance/bootstrap/WebDavPropertiesContext.php +++ b/tests/acceptance/bootstrap/WebDavPropertiesContext.php @@ -315,7 +315,7 @@ class WebDavPropertiesContext implements Context { string $propertyName, string $path, string $propertyValue, - string $namespace = null, + ?string $namespace = null, ): ResponseInterface { $user = $this->featureContext->getActualUsername($user); return WebDavHelper::proppatch( @@ -648,7 +648,7 @@ class WebDavPropertiesContext implements Context { public function checkResponseContainsProperty( ResponseInterface $response, string $key, - string $namespaceString = null + ?string $namespaceString = null ): SimpleXMLElement { $xmlPart = HttpRequestHelper::getResponseXml($response, __METHOD__); ; diff --git a/tests/acceptance/run_all_tests.sh b/tests/acceptance/run_all_tests.sh new file mode 100755 index 0000000000..423ec65cd9 --- /dev/null +++ b/tests/acceptance/run_all_tests.sh @@ -0,0 +1,68 @@ +#!/bin/bash + +# LOCAL TEST WITHOUT EXTRA ENVS +TEST_SERVER_URL="https://localhost:9200" +EXPECTED_FAILURES_FILE="tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md" + +# List of suites to run +SUITES=( + "apiArchiver" + "apiContract" + "apiCors" + "apiAsyncUpload" + "apiDownloads" + "apiDepthInfinity" + "apiLocks" + "apiActivities" + "apiSettings" + "apiGraph" + "apiServiceAvailability" + "apiGraphUserGroup" + "apiSpaces" + "apiSpacesShares" + "apiSpacesDavOperation" + "apiSearch1" + "apiSearch2" + "apiReshare" + "apiSharingNg1" + "apiSharingNg2" + "apiSharingNgShareInvitation" + "apiSharingNgLinkSharePermission" + "apiSharingNgLinkShareRoot" + "apiAccountsHashDifficulty" +) + +# Create log directory +LOG_DIR="./suite-logs" +mkdir -p "$LOG_DIR" + +SUCCESS_COUNT=0 +FAILURE_COUNT=0 + +for SUITE in "${SUITES[@]}"; do + echo "==============================================" + echo "Running suite: $SUITE" + echo "==============================================" + + LOG_FILE="$LOG_DIR/${SUITE}.log" + + # Run suite + make test-acceptance-api TEST_SERVER_URL=$TEST_SERVER_URL EXPECTED_FAILURES_FILE=$EXPECTED_FAILURES_FILE BEHAT_SUITE=$SUITE > "$LOG_FILE" 2>&1 + + # Check if suite was successful + if [ $? -eq 0 ]; then + echo "✅ Suite $SUITE completed successfully." + ((SUCCESS_COUNT++)) + else + echo "❌ Suite $SUITE failed. Check log: $LOG_FILE" + ((FAILURE_COUNT++)) + fi +done + +# Report summary +echo "==============================================" +echo "Test Summary:" +echo "✅ Successful suites: $SUCCESS_COUNT" +echo "❌ Failed suites: $FAILURE_COUNT" +echo "Logs saved in: $LOG_DIR" +echo "=============================================="