Skip to content

Commit b6d4baf

Browse files
committed
Fix tests
1 parent 4b19669 commit b6d4baf

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

src/Appwrite/Platform/Modules/Functions/Workers/Builds.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,7 @@ protected function buildDeployment(
12361236

12371237
// Combine with previous logs if deployment got past build process
12381238
$previousLogs = '';
1239-
if (!empty($deployment->getAttribute('buildEndedAt', ''))) {
1239+
if (!is_null($deployment->getAttribute('buildSize', null))) {
12401240
$previousLogs = $deployment->getAttribute('buildLogs', '');
12411241
if (!empty($previousLogs)) {
12421242
$message = $previousLogs . "\n" . $message;

tests/e2e/Services/Realtime/RealtimeConsoleClientTest.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -607,10 +607,8 @@ public function testCreateDeployment()
607607
$this->assertContains("projects.{$projectId}", $response['data']['channels']);
608608
$this->assertArrayHasKey('buildLogs', $response['data']['payload']);
609609

610-
if (!empty($response['data']['payload']['buildEndedAt'])) {
611-
$this->assertNotEmpty($response['data']['payload']['buildEndedAt']);
610+
if (!empty($response['data']['payload']['buildSize'])) {
612611
$this->assertNotEmpty($response['data']['payload']['buildStartedAt']);
613-
$this->assertNotEmpty($response['data']['payload']['buildDuration']);
614612
$this->assertNotEmpty($response['data']['payload']['buildPath']);
615613
$this->assertNotEmpty($response['data']['payload']['buildSize']);
616614
$this->assertNotEmpty($response['data']['payload']['totalSize']);
@@ -634,6 +632,13 @@ public function testCreateDeployment()
634632
$this->assertContains("projects.{$projectId}", $response['data']['channels']);
635633
$this->assertEquals("ready", $response['data']['payload']['status']);
636634

635+
$response = json_decode($client->receive(), true);
636+
$this->assertContains("functions.{$functionId}.deployments.{$deploymentId}.update", $response['data']['events']);
637+
$this->assertContains('console', $response['data']['channels']);
638+
$this->assertContains("projects.{$projectId}", $response['data']['channels']);
639+
$this->assertNotEmpty($response['data']['payload']['buildDuration']);
640+
$this->assertNotEmpty($response['data']['payload']['buildEndedAt']);
641+
637642
$client->close();
638643
}
639644
}

0 commit comments

Comments
 (0)