From 19e37ba3fd8ac668ef64327b46c6bd8d8bffe22a Mon Sep 17 00:00:00 2001 From: shimon Date: Thu, 2 Feb 2023 16:01:33 +0200 Subject: [PATCH] addressing comments --- tests/e2e/General/UsageTest.php | 10 +++++----- .../e2e/Services/Realtime/RealtimeCustomClientTest.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/e2e/General/UsageTest.php b/tests/e2e/General/UsageTest.php index 5a4e512a54..0718aad2e2 100644 --- a/tests/e2e/General/UsageTest.php +++ b/tests/e2e/General/UsageTest.php @@ -280,6 +280,7 @@ class UsageTest extends Scope $res = $this->client->call(Client::METHOD_GET, '/project/usage?range=30d', $headers); $res = $res['body']; + $this->assertEquals(9, count($res)); $this->assertEquals(30, count($res['requests'])); $this->assertEquals(30, count($res['storage'])); @@ -287,12 +288,13 @@ class UsageTest extends Scope $this->validateDates($res['requests']); $this->assertEquals($storageTotal, $res['storage'][array_key_last($res['storage'])]['value']); $this->validateDates($res['storage']); + $requestsCount++; $res = $this->client->call(Client::METHOD_GET, '/storage/usage?range=30d', array_merge($headers, [ 'x-appwrite-project' => $projectId, 'x-appwrite-mode' => 'admin' ])); - + $requestsCount++; $res = $res['body']; $this->assertEquals($storageTotal, $res['storage'][array_key_last($res['storage'])]['value']); $this->validateDates($res['storage']); @@ -312,12 +314,13 @@ class UsageTest extends Scope $this->validateDates($res['filesCreate']); $this->assertEquals($filesDelete, $res['filesDelete'][array_key_last($res['filesDelete'])]['value']); $this->validateDates($res['filesDelete']); + $requestsCount++; $res = $this->client->call(Client::METHOD_GET, '/storage/' . $bucketId . '/usage?range=30d', array_merge($headers, [ 'x-appwrite-project' => $projectId, 'x-appwrite-mode' => 'admin' ])); - + $requestsCount++; $res = $res['body']; $this->assertEquals($storageTotal, $res['filesStorage'][array_key_last($res['filesStorage'])]['value']); $this->assertEquals($filesCount, $res['filesCount'][array_key_last($res['filesCount'])]['value']); @@ -325,7 +328,6 @@ class UsageTest extends Scope $this->assertEquals($filesCreate, $res['filesCreate'][array_key_last($res['filesCreate'])]['value']); $this->assertEquals($filesDelete, $res['filesDelete'][array_key_last($res['filesDelete'])]['value']); - $requestsCount++; $data['requestsCount'] = $requestsCount; return $data; } @@ -424,11 +426,9 @@ class UsageTest extends Scope 'size' => 255, 'required' => true, ]); - $this->assertEquals('name', $res['body']['key']); $collectionsUpdate++; $requestsCount++; - sleep(20); for ($i = 0; $i < 10; $i++) { diff --git a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php index db4c1b9517..7f09cb5703 100644 --- a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php +++ b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php @@ -106,6 +106,7 @@ class RealtimeCustomClientTest extends Scope $this->assertContains('collections.1.documents.1', $response['data']['channels']); $this->assertContains('collections.2.documents.2', $response['data']['channels']); $this->assertEquals($userId, $response['data']['user']['$id']); + $client->close(); } @@ -211,7 +212,6 @@ class RealtimeCustomClientTest extends Scope $this->assertEquals('Message format is not valid.', $response['data']['message']); - $client->close(); }