diff --git a/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Audits/Get.php b/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Audits/Get.php deleted file mode 100644 index 407490a512..0000000000 --- a/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Audits/Get.php +++ /dev/null @@ -1,42 +0,0 @@ -setHttpMethod(Base::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/health/queue/audits') - ->desc('Get audits queue') - ->groups(['api', 'health']) - ->label('scope', 'health.read') - ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisherForAudits') - ->inject('response') - ->callback($this->action(...)); - } - - public function action(int|string $threshold, Audit $publisherForAudits, Response $response): void - { - $threshold = (int) $threshold; - - $size = $publisherForAudits->getSize(); - - $this->assertQueueThreshold($size, $threshold); - - $response->dynamic(new Document(['size' => $size]), Response::MODEL_HEALTH_QUEUE); - } -} diff --git a/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Builds/Get.php b/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Builds/Get.php deleted file mode 100644 index 86514182a0..0000000000 --- a/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Builds/Get.php +++ /dev/null @@ -1,42 +0,0 @@ -setHttpMethod(Base::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/health/queue/builds') - ->desc('Get builds queue') - ->groups(['api', 'health']) - ->label('scope', 'health.read') - ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisherForBuilds') - ->inject('response') - ->callback($this->action(...)); - } - - public function action(int|string $threshold, BuildPublisher $publisherForBuilds, Response $response): void - { - $threshold = (int) $threshold; - - $size = $publisherForBuilds->getSize(); - - $this->assertQueueThreshold($size, $threshold); - - $response->dynamic(new Document(['size' => $size]), Response::MODEL_HEALTH_QUEUE); - } -} diff --git a/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Certificates/Get.php b/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Certificates/Get.php deleted file mode 100644 index 412a928f08..0000000000 --- a/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Certificates/Get.php +++ /dev/null @@ -1,42 +0,0 @@ -setHttpMethod(Base::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/health/queue/certificates') - ->desc('Get certificates queue') - ->groups(['api', 'health']) - ->label('scope', 'health.read') - ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisherForCertificates') - ->inject('response') - ->callback($this->action(...)); - } - - public function action(int|string $threshold, Certificate $publisherForCertificates, Response $response): void - { - $threshold = (int) $threshold; - - $size = $publisherForCertificates->getSize(); - - $this->assertQueueThreshold($size, $threshold); - - $response->dynamic(new Document(['size' => $size]), Response::MODEL_HEALTH_QUEUE); - } -} diff --git a/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Databases/Get.php b/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Databases/Get.php deleted file mode 100644 index 9b74be9029..0000000000 --- a/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Databases/Get.php +++ /dev/null @@ -1,44 +0,0 @@ -setHttpMethod(Base::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/health/queue/databases') - ->desc('Get databases queue') - ->groups(['api', 'health']) - ->label('scope', 'health.read') - ->param('name', 'database_db_main', new Text(256), 'Queue name for which to check the queue size', true) - ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisherForDatabase') - ->inject('response') - ->callback($this->action(...)); - } - - public function action(string $name, int|string $threshold, Database $publisherForDatabase, Response $response): void - { - $threshold = (int) $threshold; - $size = $publisherForDatabase->getSize(queue: new Queue($name)); - - $this->assertQueueThreshold($size, $threshold); - - $response->dynamic(new Document(['size' => $size]), Response::MODEL_HEALTH_QUEUE); - } -} diff --git a/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Deletes/Get.php b/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Deletes/Get.php deleted file mode 100644 index 296274d67f..0000000000 --- a/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Deletes/Get.php +++ /dev/null @@ -1,42 +0,0 @@ -setHttpMethod(Base::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/health/queue/deletes') - ->desc('Get deletes queue') - ->groups(['api', 'health']) - ->label('scope', 'health.read') - ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisherForDeletes') - ->inject('response') - ->callback($this->action(...)); - } - - public function action(int|string $threshold, Delete $publisherForDeletes, Response $response): void - { - $threshold = (int) $threshold; - - $size = $publisherForDeletes->getSize(); - - $this->assertQueueThreshold($size, $threshold); - - $response->dynamic(new Document(['size' => $size]), Response::MODEL_HEALTH_QUEUE); - } -} diff --git a/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Functions/Get.php b/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Functions/Get.php deleted file mode 100644 index 07f8f9afb5..0000000000 --- a/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Functions/Get.php +++ /dev/null @@ -1,42 +0,0 @@ -setHttpMethod(Base::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/health/queue/functions') - ->desc('Get functions queue') - ->groups(['api', 'health']) - ->label('scope', 'health.read') - ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisherForFunctions') - ->inject('response') - ->callback($this->action(...)); - } - - public function action(int|string $threshold, FunctionPublisher $publisherForFunctions, Response $response): void - { - $threshold = (int) $threshold; - - $size = $publisherForFunctions->getSize(); - - $this->assertQueueThreshold($size, $threshold); - - $response->dynamic(new Document(['size' => $size]), Response::MODEL_HEALTH_QUEUE); - } -} diff --git a/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Mails/Get.php b/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Mails/Get.php deleted file mode 100644 index ffe8b2c4e0..0000000000 --- a/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Mails/Get.php +++ /dev/null @@ -1,42 +0,0 @@ -setHttpMethod(Base::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/health/queue/mails') - ->desc('Get mails queue') - ->groups(['api', 'health']) - ->label('scope', 'health.read') - ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisherForMails') - ->inject('response') - ->callback($this->action(...)); - } - - public function action(int|string $threshold, MailPublisher $publisherForMails, Response $response): void - { - $threshold = (int) $threshold; - - $size = $publisherForMails->getSize(); - - $this->assertQueueThreshold($size, $threshold); - - $response->dynamic(new Document(['size' => $size]), Response::MODEL_HEALTH_QUEUE); - } -} diff --git a/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Messaging/Get.php b/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Messaging/Get.php deleted file mode 100644 index 13e96e3062..0000000000 --- a/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Messaging/Get.php +++ /dev/null @@ -1,42 +0,0 @@ -setHttpMethod(Base::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/health/queue/messaging') - ->desc('Get messaging queue') - ->groups(['api', 'health']) - ->label('scope', 'health.read') - ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisherForMessaging') - ->inject('response') - ->callback($this->action(...)); - } - - public function action(int|string $threshold, MessagingPublisher $publisherForMessaging, Response $response): void - { - $threshold = (int) $threshold; - - $size = $publisherForMessaging->getSize(); - - $this->assertQueueThreshold($size, $threshold); - - $response->dynamic(new Document(['size' => $size]), Response::MODEL_HEALTH_QUEUE); - } -} diff --git a/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Migrations/Get.php b/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Migrations/Get.php deleted file mode 100644 index eaff76bcb7..0000000000 --- a/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Migrations/Get.php +++ /dev/null @@ -1,42 +0,0 @@ -setHttpMethod(Base::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/health/queue/migrations') - ->desc('Get migrations queue') - ->groups(['api', 'health']) - ->label('scope', 'health.read') - ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisherForMigrations') - ->inject('response') - ->callback($this->action(...)); - } - - public function action(int|string $threshold, MigrationPublisher $publisherForMigrations, Response $response): void - { - $threshold = (int) $threshold; - - $size = $publisherForMigrations->getSize(); - - $this->assertQueueThreshold($size, $threshold); - - $response->dynamic(new Document(['size' => $size]), Response::MODEL_HEALTH_QUEUE); - } -} diff --git a/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Notifications/Get.php b/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Notifications/Get.php deleted file mode 100644 index 4f3698597e..0000000000 --- a/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Notifications/Get.php +++ /dev/null @@ -1,42 +0,0 @@ -setHttpMethod(Base::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/health/queue/notifications') - ->desc('Get notifications queue') - ->groups(['api', 'health']) - ->label('scope', 'health.read') - ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisherForNotifications') - ->inject('response') - ->callback($this->action(...)); - } - - public function action(int|string $threshold, NotificationPublisher $publisherForNotifications, Response $response): void - { - $threshold = (int) $threshold; - - $size = $publisherForNotifications->getSize(); - - $this->assertQueueThreshold($size, $threshold); - - $response->dynamic(new Document(['size' => $size]), Response::MODEL_HEALTH_QUEUE); - } -} diff --git a/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/StatsResources/Get.php b/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/StatsResources/Get.php deleted file mode 100644 index f6e9fcc930..0000000000 --- a/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/StatsResources/Get.php +++ /dev/null @@ -1,42 +0,0 @@ -setHttpMethod(Base::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/health/queue/stats-resources') - ->desc('Get stats resources queue') - ->groups(['api', 'health']) - ->label('scope', 'health.read') - ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisherForStatsResources') - ->inject('response') - ->callback($this->action(...)); - } - - public function action(int|string $threshold, StatsResourcesPublisher $publisherForStatsResources, Response $response): void - { - $threshold = (int) $threshold; - - $size = $publisherForStatsResources->getSize(); - - $this->assertQueueThreshold($size, $threshold); - - $response->dynamic(new Document(['size' => $size]), Response::MODEL_HEALTH_QUEUE); - } -} diff --git a/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/StatsUsage/Get.php b/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/StatsUsage/Get.php deleted file mode 100644 index a8fd755bfb..0000000000 --- a/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/StatsUsage/Get.php +++ /dev/null @@ -1,42 +0,0 @@ -setHttpMethod(Base::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/health/queue/stats-usage') - ->desc('Get stats usage queue') - ->groups(['api', 'health']) - ->label('scope', 'health.read') - ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('publisherForUsage') - ->inject('response') - ->callback($this->action(...)); - } - - public function action(int|string $threshold, UsagePublisher $publisherForUsage, Response $response): void - { - $threshold = (int) $threshold; - - $size = $publisherForUsage->getSize(); - - $this->assertQueueThreshold($size, $threshold); - - $response->dynamic(new Document(['size' => $size]), Response::MODEL_HEALTH_QUEUE); - } -} diff --git a/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Webhooks/Get.php b/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Webhooks/Get.php deleted file mode 100644 index 11422b6f52..0000000000 --- a/src/Appwrite/Platform/Modules/Health/Http/Health/Queue/Webhooks/Get.php +++ /dev/null @@ -1,42 +0,0 @@ -setHttpMethod(Base::HTTP_REQUEST_METHOD_GET) - ->setHttpPath('/v1/health/queue/webhooks') - ->desc('Get webhooks queue') - ->groups(['api', 'health']) - ->label('scope', 'health.read') - ->param('threshold', 5000, new Integer(true), 'Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.', true) - ->inject('queueForWebhooks') - ->inject('response') - ->callback($this->action(...)); - } - - public function action(int|string $threshold, Webhook $queueForWebhooks, Response $response): void - { - $threshold = (int) $threshold; - - $size = $queueForWebhooks->getSize(); - - $this->assertQueueThreshold($size, $threshold); - - $response->dynamic(new Document(['size' => $size]), Response::MODEL_HEALTH_QUEUE); - } -} diff --git a/src/Appwrite/Platform/Modules/Health/Services/Http.php b/src/Appwrite/Platform/Modules/Health/Services/Http.php index 16b7a8fca8..eeadcb4291 100644 --- a/src/Appwrite/Platform/Modules/Health/Services/Http.php +++ b/src/Appwrite/Platform/Modules/Health/Services/Http.php @@ -9,20 +9,7 @@ use Appwrite\Platform\Modules\Health\Http\Health\DB\Get as GetDB; use Appwrite\Platform\Modules\Health\Http\Health\Geo\Get as GetGeo; use Appwrite\Platform\Modules\Health\Http\Health\Get as GetHealth; use Appwrite\Platform\Modules\Health\Http\Health\PubSub\Get as GetPubSub; -use Appwrite\Platform\Modules\Health\Http\Health\Queue\Audits\Get as GetQueueAudits; -use Appwrite\Platform\Modules\Health\Http\Health\Queue\Builds\Get as GetQueueBuilds; -use Appwrite\Platform\Modules\Health\Http\Health\Queue\Certificates\Get as GetQueueCertificates; -use Appwrite\Platform\Modules\Health\Http\Health\Queue\Databases\Get as GetQueueDatabases; -use Appwrite\Platform\Modules\Health\Http\Health\Queue\Deletes\Get as GetQueueDeletes; use Appwrite\Platform\Modules\Health\Http\Health\Queue\Failed\Get as GetFailedJobs; -use Appwrite\Platform\Modules\Health\Http\Health\Queue\Functions\Get as GetQueueFunctions; -use Appwrite\Platform\Modules\Health\Http\Health\Queue\Mails\Get as GetQueueMails; -use Appwrite\Platform\Modules\Health\Http\Health\Queue\Messaging\Get as GetQueueMessaging; -use Appwrite\Platform\Modules\Health\Http\Health\Queue\Migrations\Get as GetQueueMigrations; -use Appwrite\Platform\Modules\Health\Http\Health\Queue\Notifications\Get as GetQueueNotifications; -use Appwrite\Platform\Modules\Health\Http\Health\Queue\StatsResources\Get as GetQueueStatsResources; -use Appwrite\Platform\Modules\Health\Http\Health\Queue\StatsUsage\Get as GetQueueUsage; -use Appwrite\Platform\Modules\Health\Http\Health\Queue\Webhooks\Get as GetQueueWebhooks; use Appwrite\Platform\Modules\Health\Http\Health\Stats\Get as GetStats; use Appwrite\Platform\Modules\Health\Http\Health\Storage\Get as GetStorage; use Appwrite\Platform\Modules\Health\Http\Health\Storage\Local\Get as GetStorageLocal; @@ -48,19 +35,6 @@ class Http extends Service $this->addAction(GetAntivirus::getName(), new GetAntivirus()); $this->addAction(GetGeo::getName(), new GetGeo()); - $this->addAction(GetQueueAudits::getName(), new GetQueueAudits()); - $this->addAction(GetQueueWebhooks::getName(), new GetQueueWebhooks()); - $this->addAction(GetQueueCertificates::getName(), new GetQueueCertificates()); - $this->addAction(GetQueueBuilds::getName(), new GetQueueBuilds()); - $this->addAction(GetQueueDatabases::getName(), new GetQueueDatabases()); - $this->addAction(GetQueueDeletes::getName(), new GetQueueDeletes()); - $this->addAction(GetQueueMails::getName(), new GetQueueMails()); - $this->addAction(GetQueueMessaging::getName(), new GetQueueMessaging()); - $this->addAction(GetQueueMigrations::getName(), new GetQueueMigrations()); - $this->addAction(GetQueueNotifications::getName(), new GetQueueNotifications()); - $this->addAction(GetQueueFunctions::getName(), new GetQueueFunctions()); - $this->addAction(GetQueueStatsResources::getName(), new GetQueueStatsResources()); - $this->addAction(GetQueueUsage::getName(), new GetQueueUsage()); $this->addAction(GetFailedJobs::getName(), new GetFailedJobs()); $this->addAction(GetStats::getName(), new GetStats()); diff --git a/tests/e2e/Services/Health/AuditsQueueTest.php b/tests/e2e/Services/Health/AuditsQueueTest.php deleted file mode 100644 index a5d5ff055e..0000000000 --- a/tests/e2e/Services/Health/AuditsQueueTest.php +++ /dev/null @@ -1,19 +0,0 @@ -callGet('/health/queue/audits'); - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertIsInt($response['body']['size']); - $this->assertLessThan(100, $response['body']['size']); - - $failure = $this->callGet('/health/queue/audits', ['threshold' => '0']); - $this->assertEquals(503, $failure['headers']['status-code']); - } -} diff --git a/tests/e2e/Services/Health/BuildsQueueTest.php b/tests/e2e/Services/Health/BuildsQueueTest.php deleted file mode 100644 index aa750274e6..0000000000 --- a/tests/e2e/Services/Health/BuildsQueueTest.php +++ /dev/null @@ -1,19 +0,0 @@ -callGet('/health/queue/builds'); - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertIsInt($response['body']['size']); - $this->assertLessThan(100, $response['body']['size']); - - $failure = $this->callGet('/health/queue/builds', ['threshold' => '0']); - $this->assertEquals(503, $failure['headers']['status-code']); - } -} diff --git a/tests/e2e/Services/Health/CertificatesQueueTest.php b/tests/e2e/Services/Health/CertificatesQueueTest.php deleted file mode 100644 index fa5c430e63..0000000000 --- a/tests/e2e/Services/Health/CertificatesQueueTest.php +++ /dev/null @@ -1,19 +0,0 @@ -callGet('/health/queue/certificates'); - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertIsInt($response['body']['size']); - $this->assertLessThan(100, $response['body']['size']); - - $failure = $this->callGet('/health/queue/certificates', ['threshold' => '0']); - $this->assertEquals(503, $failure['headers']['status-code']); - } -} diff --git a/tests/e2e/Services/Health/DatabasesQueueTest.php b/tests/e2e/Services/Health/DatabasesQueueTest.php deleted file mode 100644 index 25a866788d..0000000000 --- a/tests/e2e/Services/Health/DatabasesQueueTest.php +++ /dev/null @@ -1,19 +0,0 @@ -callGet('/health/queue/databases', ['name' => 'database_db_main']); - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertIsInt($response['body']['size']); - $this->assertLessThan(100, $response['body']['size']); - - $failure = $this->callGet('/health/queue/databases', ['name' => 'database_db_main', 'threshold' => '0']); - $this->assertEquals(503, $failure['headers']['status-code']); - } -} diff --git a/tests/e2e/Services/Health/DeletesQueueTest.php b/tests/e2e/Services/Health/DeletesQueueTest.php deleted file mode 100644 index 85754abd0a..0000000000 --- a/tests/e2e/Services/Health/DeletesQueueTest.php +++ /dev/null @@ -1,19 +0,0 @@ -callGet('/health/queue/deletes'); - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertIsInt($response['body']['size']); - $this->assertLessThan(100, $response['body']['size']); - - $failure = $this->callGet('/health/queue/deletes', ['threshold' => '0']); - $this->assertEquals(503, $failure['headers']['status-code']); - } -} diff --git a/tests/e2e/Services/Health/FunctionsQueueTest.php b/tests/e2e/Services/Health/FunctionsQueueTest.php deleted file mode 100644 index 334a89edd6..0000000000 --- a/tests/e2e/Services/Health/FunctionsQueueTest.php +++ /dev/null @@ -1,19 +0,0 @@ -callGet('/health/queue/functions'); - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertIsInt($response['body']['size']); - $this->assertLessThan(100, $response['body']['size']); - - $failure = $this->callGet('/health/queue/functions', ['threshold' => '0']); - $this->assertEquals(503, $failure['headers']['status-code']); - } -} diff --git a/tests/e2e/Services/Health/MailsQueueTest.php b/tests/e2e/Services/Health/MailsQueueTest.php deleted file mode 100644 index d9b2cda431..0000000000 --- a/tests/e2e/Services/Health/MailsQueueTest.php +++ /dev/null @@ -1,19 +0,0 @@ -callGet('/health/queue/mails'); - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertIsInt($response['body']['size']); - $this->assertLessThan(100, $response['body']['size']); - - $failure = $this->callGet('/health/queue/mails', ['threshold' => '0']); - $this->assertEquals(503, $failure['headers']['status-code']); - } -} diff --git a/tests/e2e/Services/Health/MessagingQueueTest.php b/tests/e2e/Services/Health/MessagingQueueTest.php deleted file mode 100644 index 8fbb02189e..0000000000 --- a/tests/e2e/Services/Health/MessagingQueueTest.php +++ /dev/null @@ -1,19 +0,0 @@ -callGet('/health/queue/messaging'); - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertIsInt($response['body']['size']); - $this->assertLessThan(100, $response['body']['size']); - - $failure = $this->callGet('/health/queue/messaging', ['threshold' => '0']); - $this->assertEquals(503, $failure['headers']['status-code']); - } -} diff --git a/tests/e2e/Services/Health/MigrationsQueueTest.php b/tests/e2e/Services/Health/MigrationsQueueTest.php deleted file mode 100644 index 8655926018..0000000000 --- a/tests/e2e/Services/Health/MigrationsQueueTest.php +++ /dev/null @@ -1,19 +0,0 @@ -callGet('/health/queue/migrations'); - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertIsInt($response['body']['size']); - $this->assertLessThan(100, $response['body']['size']); - - $failure = $this->callGet('/health/queue/migrations', ['threshold' => '0']); - $this->assertEquals(503, $failure['headers']['status-code']); - } -} diff --git a/tests/e2e/Services/Health/StatsResourcesQueueTest.php b/tests/e2e/Services/Health/StatsResourcesQueueTest.php deleted file mode 100644 index e251926179..0000000000 --- a/tests/e2e/Services/Health/StatsResourcesQueueTest.php +++ /dev/null @@ -1,19 +0,0 @@ -callGet('/health/queue/stats-resources'); - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertIsInt($response['body']['size']); - $this->assertLessThan(100, $response['body']['size']); - - $failure = $this->callGet('/health/queue/stats-resources', ['threshold' => '0']); - $this->assertEquals(503, $failure['headers']['status-code']); - } -} diff --git a/tests/e2e/Services/Health/StatsUsageQueueTest.php b/tests/e2e/Services/Health/StatsUsageQueueTest.php deleted file mode 100644 index fda30c9bb5..0000000000 --- a/tests/e2e/Services/Health/StatsUsageQueueTest.php +++ /dev/null @@ -1,19 +0,0 @@ -callGet('/health/queue/stats-usage'); - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertIsInt($response['body']['size']); - $this->assertLessThan(100, $response['body']['size']); - - $failure = $this->callGet('/health/queue/stats-usage', ['threshold' => '0']); - $this->assertEquals(503, $failure['headers']['status-code']); - } -} diff --git a/tests/e2e/Services/Health/WebhooksQueueTest.php b/tests/e2e/Services/Health/WebhooksQueueTest.php deleted file mode 100644 index 1171686069..0000000000 --- a/tests/e2e/Services/Health/WebhooksQueueTest.php +++ /dev/null @@ -1,19 +0,0 @@ -callGet('/health/queue/webhooks'); - $this->assertEquals(200, $response['headers']['status-code']); - $this->assertIsInt($response['body']['size']); - $this->assertLessThan(100, $response['body']['size']); - - $failure = $this->callGet('/health/queue/webhooks', ['threshold' => '0']); - $this->assertEquals(503, $failure['headers']['status-code']); - } -} diff --git a/tests/e2e/Services/Notifications/NotificationsBase.php b/tests/e2e/Services/Notifications/NotificationsBase.php index e6c8babe9b..534fa4125a 100644 --- a/tests/e2e/Services/Notifications/NotificationsBase.php +++ b/tests/e2e/Services/Notifications/NotificationsBase.php @@ -8,16 +8,14 @@ use Utopia\Database\Helpers\ID; use Utopia\System\System; /** - * End-to-end coverage for the notifications queue health surface and the + * End-to-end coverage for the notifications failed-jobs health surface and the * notifications user-facing API. * * The notification worker itself is exercised in unit tests with a pinned * queue payload; the server side cannot deterministically inject a - * Notification onto the live queue without an admin endpoint, so the health - * portion validates the public contract that ops and KEDA scale on: + * Notification onto the live queue without an admin endpoint. This suite keeps + * coverage for the failed-jobs health surface and the user-facing API: * - * - GET /v1/health/queue/notifications returns the live queue depth - * - the threshold guard returns 503 when the depth exceeds the budget * - the failed-jobs surface accepts the notifications queue name * * The notifications portion exercises the full webhook-paused fanout end-to-end: @@ -37,28 +35,6 @@ use Utopia\System\System; */ trait NotificationsBase { - public function testHealthQueueNotificationsReportsSize(): void - { - $response = $this->client->call(Client::METHOD_GET, '/health/queue/notifications', \array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders())); - - $this->assertSame(200, $response['headers']['status-code']); - $this->assertIsInt($response['body']['size']); - $this->assertGreaterThanOrEqual(0, $response['body']['size']); - } - - public function testHealthQueueNotificationsThresholdGuard(): void - { - $response = $this->client->call(Client::METHOD_GET, '/health/queue/notifications', \array_merge([ - 'content-type' => 'application/json', - 'x-appwrite-project' => $this->getProject()['$id'], - ], $this->getHeaders()), ['threshold' => '0']); - - $this->assertContains($response['headers']['status-code'], [200, 503]); - } - public function testHealthQueueFailedAcceptsNotifications(): void { $response = $this->client->call(Client::METHOD_GET, '/health/queue/failed/v1-notifications', \array_merge([