Test fixes
This commit is contained in:
parent
d3929a5bae
commit
18f86b057d
4 changed files with 37 additions and 12 deletions
|
@ -107,9 +107,43 @@ class FunctionsClientTest extends Scope
|
|||
$this->assertIsArray($deployment['body']['data']);
|
||||
$this->assertArrayNotHasKey('errors', $deployment['body']);
|
||||
|
||||
sleep(15);
|
||||
// Poll get deployment until an error, or status is either 'ready' or 'failed'
|
||||
$deployment = $deployment['body']['data']['functionsCreateDeployment'];
|
||||
$deploymentId = $deployment['_id'];
|
||||
|
||||
return $deployment['body']['data']['functionsCreateDeployment'];
|
||||
$query = $this->getQuery(self::$GET_DEPLOYMENT);
|
||||
$gqlPayload = [
|
||||
'query' => $query,
|
||||
'variables' => [
|
||||
'functionId' => $function['_id'],
|
||||
'deploymentId' => $deploymentId,
|
||||
]
|
||||
];
|
||||
|
||||
while (true) {
|
||||
$deployment = $this->client->call(Client::METHOD_POST, '/graphql', \array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $projectId,
|
||||
], $this->getHeaders()), $gqlPayload);
|
||||
|
||||
$this->assertIsArray($deployment['body']['data']);
|
||||
$this->assertArrayNotHasKey('errors', $deployment['body']);
|
||||
|
||||
$deployment = $deployment['body']['data']['functionsGetDeployment'];
|
||||
|
||||
if (
|
||||
$deployment['status'] === 'ready'
|
||||
|| $deployment['status'] === 'failed'
|
||||
) {
|
||||
break;
|
||||
}
|
||||
|
||||
\sleep(1);
|
||||
}
|
||||
|
||||
$this->assertEquals('ready', $deployment['status']);
|
||||
|
||||
return $deployment;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -593,7 +593,7 @@ class ProjectsConsoleClientTest extends Scope
|
|||
|
||||
$this->assertEquals(200, $response['headers']['status-code']);
|
||||
$this->assertEquals('Account Verification', $response['body']['subject']);
|
||||
$this->assertEquals('team@appwrite.io', $response['body']['senderEmail']);
|
||||
$this->assertEquals('', $response['body']['senderEmail']);
|
||||
$this->assertEquals('verification', $response['body']['type']);
|
||||
$this->assertEquals('en-us', $response['body']['locale']);
|
||||
|
||||
|
|
|
@ -451,7 +451,6 @@ class RealtimeConsoleClientTest extends Scope
|
|||
|
||||
$this->assertEquals(201, $response1['headers']['status-code']);
|
||||
|
||||
|
||||
$projectId = 'console';
|
||||
|
||||
$client = $this->getWebsocket(['console'], [
|
||||
|
|
|
@ -416,18 +416,10 @@ class WebhooksCustomServerTest extends Scope
|
|||
$this->assertEquals($webhook['method'], 'POST');
|
||||
$this->assertEquals($webhook['headers']['Content-Type'], 'application/json');
|
||||
$this->assertEquals($webhook['headers']['User-Agent'], 'Appwrite-Server vdev. Please report abuse at security@appwrite.io');
|
||||
// $this->assertStringContainsString('functions.*', $webhook['headers']['X-Appwrite-Webhook-Events']);
|
||||
// $this->assertStringContainsString('functions.*.create', $webhook['headers']['X-Appwrite-Webhook-Events']);
|
||||
// $this->assertStringContainsString("functions.{$id}", $webhook['headers']['X-Appwrite-Webhook-Events']);
|
||||
// $this->assertStringContainsString("functions.{$id}.create", $webhook['headers']['X-Appwrite-Webhook-Events']); TODO @christyjacob4 : enable test once we allow functions.* events
|
||||
$this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Signature'], $signatureExpected);
|
||||
$this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Id'] ?? '', $this->getProject()['webhookId']);
|
||||
$this->assertEquals($webhook['headers']['X-Appwrite-Webhook-Project-Id'] ?? '', $this->getProject()['$id']);
|
||||
|
||||
/**
|
||||
* Test for FAILURE
|
||||
*/
|
||||
|
||||
return [
|
||||
'functionId' => $id,
|
||||
];
|
||||
|
|
Loading…
Reference in a new issue