From a0554ca91eb2cb4189187fca839cc087f624b067 Mon Sep 17 00:00:00 2001 From: shimon Date: Sun, 15 Jan 2023 12:25:03 +0200 Subject: [PATCH] usage test --- app/controllers/api/functions.php | 1 - tests/e2e/Services/Storage/StorageConsoleClientTest.php | 1 - tests/e2e/Services/Users/UsersConsoleClientTest.php | 1 - tests/unit/Usage/StatsTest.php | 8 +------- 4 files changed, 1 insertion(+), 10 deletions(-) diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 88fe535b26..2e734fbb6f 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -1009,7 +1009,6 @@ App::post('/v1/functions/:functionId/executions') ->addMetric('executions.compute', (int)($executionResponse['duration'] * 1000))// per project ->addMetric("{$function->getInternalId()}" . ".executions.compute", (int)($executionResponse['duration'] * 1000))// per function ; - } catch (\Throwable $th) { $interval = (new \DateTime())->diff(new \DateTime($execution->getCreatedAt())); $execution diff --git a/tests/e2e/Services/Storage/StorageConsoleClientTest.php b/tests/e2e/Services/Storage/StorageConsoleClientTest.php index de059b180a..e24ac524a6 100644 --- a/tests/e2e/Services/Storage/StorageConsoleClientTest.php +++ b/tests/e2e/Services/Storage/StorageConsoleClientTest.php @@ -44,7 +44,6 @@ class StorageConsoleClientTest extends Scope $this->assertIsArray($response['body']['bucketsCount']); $this->assertIsArray($response['body']['filesCount']); $this->assertIsArray($response['body']['filesStorage']); - } public function testGetStorageBucketUsage() diff --git a/tests/e2e/Services/Users/UsersConsoleClientTest.php b/tests/e2e/Services/Users/UsersConsoleClientTest.php index 6bb8890721..616a2ca38b 100644 --- a/tests/e2e/Services/Users/UsersConsoleClientTest.php +++ b/tests/e2e/Services/Users/UsersConsoleClientTest.php @@ -42,6 +42,5 @@ class UsersConsoleClientTest extends Scope $this->assertEquals($response['body']['range'], '24h'); $this->assertIsArray($response['body']['usersCount']); $this->assertIsArray($response['body']['sessionsCount']); - } } diff --git a/tests/unit/Usage/StatsTest.php b/tests/unit/Usage/StatsTest.php index c728a57733..0c9914f4bd 100644 --- a/tests/unit/Usage/StatsTest.php +++ b/tests/unit/Usage/StatsTest.php @@ -12,16 +12,10 @@ use Utopia\Queue\Connection; class StatsTest extends TestCase { - /** - * @var Connection - */ protected ?Connection $connection = null; - /** - * @var Client - */ protected ?Client $client = null; - const QUEUE_NAME = 'usage-test-q'; + protected const QUEUE_NAME = 'usage-test-q'; public function setUp(): void {