From 18022d680ba32c348e1895e8ba469a4257cc2dad Mon Sep 17 00:00:00 2001 From: Khushboo Verma <43381712+vermakhushboo@users.noreply.github.com> Date: Wed, 19 Mar 2025 16:22:38 +0530 Subject: [PATCH] Assert exception --- .../Services/Sites/SitesCustomServerTest.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/e2e/Services/Sites/SitesCustomServerTest.php b/tests/e2e/Services/Sites/SitesCustomServerTest.php index 8c2a1c3970..ac6a74aeb5 100644 --- a/tests/e2e/Services/Sites/SitesCustomServerTest.php +++ b/tests/e2e/Services/Sites/SitesCustomServerTest.php @@ -2320,19 +2320,20 @@ class SitesCustomServerTest extends Scope $domain = $this->setupSiteDomain($siteId); $this->assertNotEmpty($domain); - $deploymentId = $this->setupDeployment($siteId, [ + $deployment = $this->createDeployment($siteId, [ 'code' => $this->packageSite('empty'), - 'activate' => 'true' + 'activate' => true ]); + $this->assertEquals(202, $deployment['headers']['status-code']); + + $deploymentId = $deployment['body']['$id']; $this->assertNotEmpty($deploymentId); - $site = $this->getSite($siteId); - $this->assertEquals('200', $site['headers']['status-code']); - - $proxyClient = new Client(); - $proxyClient->setEndpoint('http://' . $domain); - $response = $proxyClient->call(Client::METHOD_GET, '/'); - $this->assertEquals(200, $response['headers']['status-code']); + $this->assertEventually(function () use ($siteId, $deploymentId) { + $deployment = $this->getDeployment($siteId, $deploymentId); + $this->assertEquals('failed', $deployment['body']['status'], 'Deployment status is failed, deployment: ' . json_encode($deployment['body'], JSON_PRETTY_PRINT)); + $this->assertStringContainsString("ERROR: No source code found. Please ensure your source directory exists and isn't empty.", $deployment['body']['buildLogs']); + }, 100000, 500); $this->cleanupSite($siteId); }