From fea06addb57526e4a5fd842f7f666c3d4fefd02c Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 20 Jul 2026 21:55:29 +1200 Subject: [PATCH] Wait for function domain activation in tests (#12908) --- tests/e2e/Services/Functions/FunctionsBase.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/e2e/Services/Functions/FunctionsBase.php b/tests/e2e/Services/Functions/FunctionsBase.php index 00d6a14c3f..4a55680e31 100644 --- a/tests/e2e/Services/Functions/FunctionsBase.php +++ b/tests/e2e/Services/Functions/FunctionsBase.php @@ -119,6 +119,24 @@ trait FunctionsBase } $this->assertEquals($deploymentId, $function['body']['deploymentId'] ?? '', 'Deployment is not activated, deployment: ' . json_encode($function['body'], JSON_PRETTY_PRINT)); + + $rules = $this->client->call(Client::METHOD_GET, '/proxy/rules', [ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + 'x-appwrite-key' => $this->getProject()['apiKey'], + ], [ + 'queries' => [ + Query::equal('deploymentResourceId', [$functionId])->toString(), + Query::equal('trigger', ['manual'])->toString(), + Query::equal('type', ['deployment'])->toString(), + Query::equal('deploymentVcsProviderBranch', [''])->toString(), + ], + ]); + + $this->assertSame(200, $rules['headers']['status-code'], 'Failed to list function domains: ' . json_encode($rules['body'], JSON_PRETTY_PRINT)); + foreach ($rules['body']['rules'] as $rule) { + $this->assertSame($deploymentId, $rule['deploymentId'] ?? '', 'Function domain is not activated, rule: ' . json_encode($rule, JSON_PRETTY_PRINT)); + } }, 120000, 500); }