diff --git a/tests/e2e/Services/Account/AccountBase.php b/tests/e2e/Services/Account/AccountBase.php index 97da90a941..27be5ad505 100644 --- a/tests/e2e/Services/Account/AccountBase.php +++ b/tests/e2e/Services/Account/AccountBase.php @@ -2,7 +2,7 @@ namespace Tests\E2E\Services\Account; -use Appwrite\Tests\FlakyTest; +use Appwrite\Tests\Retry; use Tests\E2E\Client; trait AccountBase @@ -518,7 +518,7 @@ trait AccountBase /** * @depends testUpdateAccountName */ - #[FlakyTest(retries: 1)] + #[Retry(count: 1)] public function testUpdateAccountPassword($data): array { $email = $data['email'] ?? ''; diff --git a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php index 6f4d182d56..a727ad4359 100644 --- a/tests/e2e/Services/Functions/FunctionsCustomServerTest.php +++ b/tests/e2e/Services/Functions/FunctionsCustomServerTest.php @@ -2,7 +2,7 @@ namespace Tests\E2E\Services\Functions; -use Appwrite\Tests\FlakyTest; +use Appwrite\Tests\Retry; use CURLFile; use Tests\E2E\Client; use Tests\E2E\Scopes\ProjectCustom; @@ -1207,7 +1207,7 @@ class FunctionsCustomServerTest extends Scope $this->assertEquals(204, $response['headers']['status-code']); } - #[FlakyTest(retries: 1)] + #[Retry(count: 1)] public function testCreateCustomRubyExecution() { $name = 'ruby-3.1'; diff --git a/tests/e2e/Services/Webhooks/WebhooksBase.php b/tests/e2e/Services/Webhooks/WebhooksBase.php index 03854978c1..733ed1ca6b 100644 --- a/tests/e2e/Services/Webhooks/WebhooksBase.php +++ b/tests/e2e/Services/Webhooks/WebhooksBase.php @@ -2,7 +2,7 @@ namespace Tests\E2E\Services\Webhooks; -use Appwrite\Tests\FlakyTest; +use Appwrite\Tests\Retry; use CURLFile; use Tests\E2E\Client; @@ -297,7 +297,7 @@ trait WebhooksBase /** * @depends testCreateCollection */ - #[FlakyTest(retries: 1)] + #[Retry(count: 1)] public function testDeleteDocument(array $data): array { $actorsId = $data['actorsId']; diff --git a/tests/extensions/FlakyTest.php b/tests/extensions/Retry.php similarity index 76% rename from tests/extensions/FlakyTest.php rename to tests/extensions/Retry.php index 7f930094f4..4a9e8d4d62 100644 --- a/tests/extensions/FlakyTest.php +++ b/tests/extensions/Retry.php @@ -8,9 +8,9 @@ namespace Appwrite\Tests; * Requires that the test class extends {@see TestCase} and has trait {@see Retryable}. */ #[\Attribute(\Attribute::TARGET_METHOD)] -class FlakyTest +class Retry { - public function __construct(protected int $retries = 1) + public function __construct(protected int $count = 1) { } } diff --git a/tests/extensions/Retryable.php b/tests/extensions/Retryable.php index c7fc8e22d2..b1b2f18623 100644 --- a/tests/extensions/Retryable.php +++ b/tests/extensions/Retryable.php @@ -5,13 +5,13 @@ namespace Appwrite\Tests; use PHPUnit\Framework\TestCase; /** - * Allows test methods annotated with {@see FlakyTest} to be retried. + * Allows test methods annotated with {@see Retry} to be retried. */ trait Retryable { /** * Custom runBare, hides and defers to PHPUnit {@see TestCase} runBare function, - * accounting for any retries configured by the {@see FlakyTest} annotation. + * accounting for any retries configured by the {@see Retry} annotation. * * @return void * @throws \ReflectionException @@ -49,7 +49,7 @@ trait Retryable $name->setAccessible(true); $name = $name->getValue($this); $method = $root->getMethod($name); - $attributes = $method->getAttributes(FlakyTest::class); + $attributes = $method->getAttributes(Retry::class); $attribute = $attributes[0] ?? null; $args = $attribute?->getArguments(); $retries = $args['retries'] ?? 0;