From ba71f9bff03b73dd05d3ce6b91fe5d70c75f2512 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Thu, 4 Jun 2026 14:44:14 +0530 Subject: [PATCH] Revert "Remove php-retry from CI workflows" (#12494) This reverts commit 80116398fe783d84b16f69f2e9e7ce435835971e. --- .github/workflows/ci.yml | 109 ++++++++++++------ .../VectorsDB/DatabasesConsoleClientTest.php | 2 - .../VectorsDB/DatabasesCustomClientTest.php | 2 - .../VectorsDB/DatabasesCustomServerTest.php | 2 - 4 files changed, 72 insertions(+), 43 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 23f8a54e57..c3278d76af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -327,11 +327,18 @@ jobs: run: docker compose exec -T appwrite vars - name: Run Unit Tests - timeout-minutes: 15 - run: >- - docker compose exec - -e _APP_E2E_RESPONSE_FORMAT="${{ github.event.inputs.response_format }}" - appwrite test /usr/src/code/tests/unit + uses: itznotabug/php-retry@d6bef45a8bff490babfb613e33b00d133e4062f0 # v3 + with: + max_attempts: 2 + retry_wait_seconds: 60 + timeout_minutes: 15 + job_id: ${{ job.check_run_id }} + github_token: ${{ secrets.GITHUB_TOKEN }} + test_dir: tests/unit + command: >- + docker compose exec + -e _APP_E2E_RESPONSE_FORMAT="${{ github.event.inputs.response_format }}" + appwrite test /usr/src/code/tests/unit e2e_general: name: Tests / E2E / General @@ -378,11 +385,18 @@ jobs: done - name: Run General Tests - timeout-minutes: 15 - run: >- - docker compose exec -T - -e _APP_E2E_RESPONSE_FORMAT="${{ github.event.inputs.response_format }}" - appwrite test /usr/src/code/tests/e2e/General + uses: itznotabug/php-retry@d6bef45a8bff490babfb613e33b00d133e4062f0 # v3 + with: + max_attempts: 2 + retry_wait_seconds: 60 + timeout_minutes: 15 + job_id: ${{ job.check_run_id }} + github_token: ${{ secrets.GITHUB_TOKEN }} + test_dir: tests/e2e/General + command: >- + docker compose exec -T + -e _APP_E2E_RESPONSE_FORMAT="${{ github.event.inputs.response_format }}" + appwrite test /usr/src/code/tests/e2e/General - name: Failure Logs if: failure() @@ -505,26 +519,33 @@ jobs: done - name: Run tests - timeout-minutes: ${{ matrix.timeout_minutes || 20 }} - run: | - SERVICE_PATH="/usr/src/code/tests/e2e/Services/${{ matrix.service }}" + uses: itznotabug/php-retry@d6bef45a8bff490babfb613e33b00d133e4062f0 # v3 + with: + max_attempts: 2 + retry_wait_seconds: 60 + timeout_minutes: ${{ matrix.timeout_minutes || 20 }} + job_id: ${{ job.check_run_id }} + github_token: ${{ secrets.GITHUB_TOKEN }} + test_dir: tests/e2e/Services/${{ matrix.service }} + command: | + SERVICE_PATH="/usr/src/code/tests/e2e/Services/${{ matrix.service }}" - # Services that rely on sequential test method execution (shared static state) - FUNCTIONAL_FLAG="--functional" - case "${{ matrix.service }}" in - Databases|TablesDB|Functions|Realtime|GraphQL|ProjectWebhooks) FUNCTIONAL_FLAG="" ;; - esac + # Services that rely on sequential test method execution (shared static state) + FUNCTIONAL_FLAG="--functional" + case "${{ matrix.service }}" in + Databases|TablesDB|Functions|Realtime|GraphQL|ProjectWebhooks) FUNCTIONAL_FLAG="" ;; + esac - PARATEST_PROCESSES="${{ matrix.paratest_processes }}" - if [ -z "$PARATEST_PROCESSES" ]; then - PARATEST_PROCESSES="$(nproc)" - fi + PARATEST_PROCESSES="${{ matrix.paratest_processes }}" + if [ -z "$PARATEST_PROCESSES" ]; then + PARATEST_PROCESSES="$(nproc)" + fi - docker compose exec -T \ - -e _APP_E2E_RESPONSE_FORMAT="${{ github.event.inputs.response_format }}" \ - -e _TESTS_OAUTH2_GITHUB_CLIENT_ID="${{ secrets.TESTS_OAUTH2_GITHUB_CLIENT_ID }}" \ - -e _TESTS_OAUTH2_GITHUB_CLIENT_SECRET="${{ secrets.TESTS_OAUTH2_GITHUB_CLIENT_SECRET }}" \ - appwrite vendor/bin/paratest --processes "$PARATEST_PROCESSES" $FUNCTIONAL_FLAG "$SERVICE_PATH" --exclude-group abuseEnabled --exclude-group screenshots --log-junit tests/e2e/Services/${{ matrix.service }}/junit.xml + docker compose exec -T \ + -e _APP_E2E_RESPONSE_FORMAT="${{ github.event.inputs.response_format }}" \ + -e _TESTS_OAUTH2_GITHUB_CLIENT_ID="${{ secrets.TESTS_OAUTH2_GITHUB_CLIENT_ID }}" \ + -e _TESTS_OAUTH2_GITHUB_CLIENT_SECRET="${{ secrets.TESTS_OAUTH2_GITHUB_CLIENT_SECRET }}" \ + appwrite vendor/bin/paratest --processes "$PARATEST_PROCESSES" $FUNCTIONAL_FLAG "$SERVICE_PATH" --exclude-group abuseEnabled --exclude-group screenshots --log-junit tests/e2e/Services/${{ matrix.service }}/junit.xml - name: Failure Logs if: failure() @@ -580,11 +601,18 @@ jobs: docker compose up -d --quiet-pull --wait - name: Run tests - timeout-minutes: 15 - run: >- - docker compose exec -T - -e _APP_E2E_RESPONSE_FORMAT="${{ github.event.inputs.response_format }}" - appwrite test /usr/src/code/tests/e2e --group=abuseEnabled + uses: itznotabug/php-retry@d6bef45a8bff490babfb613e33b00d133e4062f0 # v3 + with: + max_attempts: 2 + retry_wait_seconds: 60 + timeout_minutes: 15 + job_id: ${{ job.check_run_id }} + github_token: ${{ secrets.GITHUB_TOKEN }} + test_dir: tests/e2e + command: >- + docker compose exec -T + -e _APP_E2E_RESPONSE_FORMAT="${{ github.event.inputs.response_format }}" + appwrite test /usr/src/code/tests/e2e --group=abuseEnabled - name: Failure Logs if: failure() @@ -645,11 +673,18 @@ jobs: done - name: Run tests - timeout-minutes: 15 - run: >- - docker compose exec -T - -e _APP_E2E_RESPONSE_FORMAT="${{ github.event.inputs.response_format }}" - appwrite test /usr/src/code/tests/e2e/Services/Sites --group=screenshots + uses: itznotabug/php-retry@d6bef45a8bff490babfb613e33b00d133e4062f0 # v3 + with: + max_attempts: 2 + retry_wait_seconds: 60 + timeout_minutes: 15 + job_id: ${{ job.check_run_id }} + github_token: ${{ secrets.GITHUB_TOKEN }} + test_dir: tests/e2e/Services/Sites + command: >- + docker compose exec -T + -e _APP_E2E_RESPONSE_FORMAT="${{ github.event.inputs.response_format }}" + appwrite test /usr/src/code/tests/e2e/Services/Sites --group=screenshots - name: Failure Logs if: failure() diff --git a/tests/e2e/Services/Databases/VectorsDB/DatabasesConsoleClientTest.php b/tests/e2e/Services/Databases/VectorsDB/DatabasesConsoleClientTest.php index d2f8cbff92..a7cad1c0f7 100644 --- a/tests/e2e/Services/Databases/VectorsDB/DatabasesConsoleClientTest.php +++ b/tests/e2e/Services/Databases/VectorsDB/DatabasesConsoleClientTest.php @@ -4,7 +4,6 @@ namespace Tests\E2E\Services\Databases\VectorsDB; use PHPUnit\Framework\Attributes\Depends; use Tests\E2E\Client; -use Tests\E2E\Scopes\ApiVectorsDB; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideConsole; @@ -16,7 +15,6 @@ class DatabasesConsoleClientTest extends Scope { use ProjectCustom; use SideConsole; - use ApiVectorsDB; public function testCreateCollection(): array { diff --git a/tests/e2e/Services/Databases/VectorsDB/DatabasesCustomClientTest.php b/tests/e2e/Services/Databases/VectorsDB/DatabasesCustomClientTest.php index 2d29ce71bc..b27cb420b4 100644 --- a/tests/e2e/Services/Databases/VectorsDB/DatabasesCustomClientTest.php +++ b/tests/e2e/Services/Databases/VectorsDB/DatabasesCustomClientTest.php @@ -3,7 +3,6 @@ namespace Tests\E2E\Services\Databases\VectorsDB; use Tests\E2E\Client; -use Tests\E2E\Scopes\ApiVectorsDB; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideClient; @@ -17,7 +16,6 @@ class DatabasesCustomClientTest extends Scope use DatabasesBase; use ProjectCustom; use SideClient; - use ApiVectorsDB; public function testAllowedPermissions(): void { diff --git a/tests/e2e/Services/Databases/VectorsDB/DatabasesCustomServerTest.php b/tests/e2e/Services/Databases/VectorsDB/DatabasesCustomServerTest.php index 67a62569dd..b34aaef99e 100644 --- a/tests/e2e/Services/Databases/VectorsDB/DatabasesCustomServerTest.php +++ b/tests/e2e/Services/Databases/VectorsDB/DatabasesCustomServerTest.php @@ -6,7 +6,6 @@ namespace Tests\E2E\Services\Databases\VectorsDB; use PHPUnit\Framework\Attributes\Depends; use Tests\E2E\Client; -use Tests\E2E\Scopes\ApiVectorsDB; use Tests\E2E\Scopes\ProjectCustom; use Tests\E2E\Scopes\Scope; use Tests\E2E\Scopes\SideServer; @@ -20,7 +19,6 @@ class DatabasesCustomServerTest extends Scope use DatabasesBase; use ProjectCustom; use SideServer; - use ApiVectorsDB; public function testListDatabases(): array {