mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Add tests for no active deployments
This commit is contained in:
@@ -57,7 +57,7 @@ switch ($type) {
|
||||
break;
|
||||
case 'deployment_not_found':
|
||||
$label = 'No deployments available';
|
||||
$message = 'This page is empty, deploy your site to make it live.';
|
||||
$message = 'This page is empty, activate a deployment to make it live.';
|
||||
$buttons = [
|
||||
[
|
||||
'text' => 'View deployments',
|
||||
@@ -68,7 +68,7 @@ switch ($type) {
|
||||
break;
|
||||
case 'build_canceled':
|
||||
$label = 'Deployment build canceled';
|
||||
$message = 'The build process was canceled.';
|
||||
$message = 'This build was canceled and won\'t be deployed.';
|
||||
$buttons = [
|
||||
[
|
||||
'text' => 'View deployments',
|
||||
|
||||
@@ -1706,8 +1706,8 @@ class SitesCustomServerTest extends Scope
|
||||
$siteDomain = $this->setupSiteDomain($siteId);
|
||||
$this->assertNotEmpty($siteDomain);
|
||||
|
||||
$delpoymentDomain = $this->getDeploymentDomain($deploymentId);
|
||||
$this->assertNotEmpty($delpoymentDomain);
|
||||
$deploymentDomain = $this->getDeploymentDomain($deploymentId);
|
||||
$this->assertNotEmpty($deploymentDomain);
|
||||
|
||||
$proxyClient = new Client();
|
||||
$proxyClient->setEndpoint('http://' . $siteDomain);
|
||||
@@ -1718,7 +1718,7 @@ class SitesCustomServerTest extends Scope
|
||||
$contentLength = $response['headers']['content-length'];
|
||||
|
||||
$proxyClient = new Client();
|
||||
$proxyClient->setEndpoint('http://' . $delpoymentDomain);
|
||||
$proxyClient->setEndpoint('http://' . $deploymentDomain);
|
||||
$response = $proxyClient->call(Client::METHOD_GET, '/', followRedirects: false);
|
||||
$this->assertEquals(301, $response['headers']['status-code']);
|
||||
$this->assertStringContainsString('/console/auth/preview', $response['headers']['location']);
|
||||
@@ -2540,8 +2540,8 @@ class SitesCustomServerTest extends Scope
|
||||
$this->assertNotEmpty($deployment['body']['$id']);
|
||||
$this->assertEquals(true, (new DatetimeValidator())->isValid($deployment['body']['$createdAt']));
|
||||
|
||||
$delpoymentDomain = $this->getDeploymentDomain($deploymentId);
|
||||
$this->assertNotEmpty($delpoymentDomain);
|
||||
$deploymentDomain = $this->getDeploymentDomain($deploymentId);
|
||||
$this->assertNotEmpty($deploymentDomain);
|
||||
|
||||
$this->assertEventually(function () use ($siteId, $deploymentId) {
|
||||
$deployment = $this->getDeployment($siteId, $deploymentId);
|
||||
@@ -2555,7 +2555,7 @@ class SitesCustomServerTest extends Scope
|
||||
$this->assertEquals('canceled', $deployment['body']['status']);
|
||||
|
||||
$proxyClient = new Client();
|
||||
$proxyClient->setEndpoint('http://' . $delpoymentDomain);
|
||||
$proxyClient->setEndpoint('http://' . $deploymentDomain);
|
||||
$response = $proxyClient->call(Client::METHOD_GET, '/', followRedirects: false);
|
||||
$this->assertEquals(301, $response['headers']['status-code']);
|
||||
|
||||
@@ -2571,6 +2571,12 @@ class SitesCustomServerTest extends Scope
|
||||
$this->assertEquals(400, $response['headers']['status-code']);
|
||||
$this->assertStringContainsString("Deployment build canceled", $response['body']);
|
||||
|
||||
// check site domain for no active deployments
|
||||
$proxyClient->setEndpoint('http://' . $domain);
|
||||
$response = $proxyClient->call(Client::METHOD_GET, '/');
|
||||
$this->assertEquals(404, $response['headers']['status-code']);
|
||||
$this->assertStringContainsString("No deployments available", $response['body']);
|
||||
|
||||
$deployment = $this->createDeployment($siteId, [
|
||||
'code' => $this->packageSite('astro'),
|
||||
'activate' => 'true'
|
||||
@@ -2579,10 +2585,10 @@ class SitesCustomServerTest extends Scope
|
||||
$deploymentId = $deployment['body']['$id'] ?? '';
|
||||
$this->assertNotEmpty($deploymentId);
|
||||
|
||||
$delpoymentDomain = $this->getDeploymentDomain($deploymentId);
|
||||
$this->assertNotEmpty($delpoymentDomain);
|
||||
$deploymentDomain = $this->getDeploymentDomain($deploymentId);
|
||||
$this->assertNotEmpty($deploymentDomain);
|
||||
|
||||
$proxyClient->setEndpoint('http://' . $delpoymentDomain);
|
||||
$proxyClient->setEndpoint('http://' . $deploymentDomain);
|
||||
$response = $proxyClient->call(Client::METHOD_GET, '/', followRedirects: false);
|
||||
$this->assertEquals(301, $response['headers']['status-code']);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user