feat: fix failing tests
This commit is contained in:
parent
9e33960d95
commit
2c91a24928
|
@ -367,7 +367,7 @@ App::patch('/v1/functions/:functionId/deployment')
|
||||||
|
|
||||||
$function = $dbForProject->getDocument('functions', $functionId);
|
$function = $dbForProject->getDocument('functions', $functionId);
|
||||||
$deployment = $dbForProject->getDocument('deployments', $deployment);
|
$deployment = $dbForProject->getDocument('deployments', $deployment);
|
||||||
$build = $dbForProject->getDocument('builds', $deployment->getAttribute('buildId'));
|
$build = $dbForProject->getDocument('builds', $deployment->getAttribute('buildId', ''));
|
||||||
|
|
||||||
if ($function->isEmpty()) {
|
if ($function->isEmpty()) {
|
||||||
throw new Exception('Function not found', 404);
|
throw new Exception('Function not found', 404);
|
||||||
|
@ -924,8 +924,8 @@ App::post('/v1/functions/:functionId/executions')
|
||||||
\curl_close($ch);
|
\curl_close($ch);
|
||||||
|
|
||||||
$response
|
$response
|
||||||
->setStatusCode(Response::STATUS_CODE_CREATED)
|
->setStatusCode(Response::STATUS_CODE_CREATED)
|
||||||
->dynamic(new Document(json_decode($responseExecute, true)), Response::MODEL_SYNC_EXECUTION);
|
->dynamic(new Document(json_decode($responseExecute, true)), Response::MODEL_SYNC_EXECUTION);
|
||||||
});
|
});
|
||||||
|
|
||||||
App::get('/v1/functions/:functionId/executions')
|
App::get('/v1/functions/:functionId/executions')
|
||||||
|
|
|
@ -930,15 +930,10 @@ App::post('/v1/functions/:functionId/executions')
|
||||||
->inject('dbForProject')
|
->inject('dbForProject')
|
||||||
->action(
|
->action(
|
||||||
function (string $trigger, string $projectId, string $executionId, string $functionId, string $event, string $eventData, string $data, array $webhooks, string $userId, string $jwt, Response $response, Database $dbForProject) {
|
function (string $trigger, string $projectId, string $executionId, string $functionId, string $event, string $eventData, string $data, array $webhooks, string $userId, string $jwt, Response $response, Database $dbForProject) {
|
||||||
try {
|
$data = execute($trigger, $projectId, $executionId, $functionId, $dbForProject, $event, $eventData, $data, $webhooks, $userId, $jwt);
|
||||||
$data = execute($trigger, $projectId, $executionId, $functionId, $dbForProject, $event, $eventData, $data, $webhooks, $userId, $jwt);
|
$response
|
||||||
$response
|
->setStatusCode(Response::STATUS_CODE_OK)
|
||||||
->setStatusCode(Response::STATUS_CODE_OK)
|
->json($data);
|
||||||
->json($data);
|
|
||||||
} catch (Exception $e) {
|
|
||||||
logError($e, 'executeEndpoint');
|
|
||||||
throw $e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -151,7 +151,6 @@ class BuildsV1 extends Worker
|
||||||
|
|
||||||
// Build the Code
|
// Build the Code
|
||||||
try {
|
try {
|
||||||
Console::info("[ INFO ] Creating build with id: $buildId");
|
|
||||||
$deployment->setAttribute('status', 'building');
|
$deployment->setAttribute('status', 'building');
|
||||||
$deployment = $dbForProject->updateDocument('deployments', $deploymentId, $deployment);
|
$deployment = $dbForProject->updateDocument('deployments', $deploymentId, $deployment);
|
||||||
$this->createBuild($projectId, $functionId, $deploymentId, $buildId);
|
$this->createBuild($projectId, $functionId, $deploymentId, $buildId);
|
||||||
|
|
|
@ -242,7 +242,7 @@ class FunctionsCustomClientTest extends Scope
|
||||||
'content-type' => 'application/json',
|
'content-type' => 'application/json',
|
||||||
'x-appwrite-project' => $this->getProject()['$id'],
|
'x-appwrite-project' => $this->getProject()['$id'],
|
||||||
], [
|
], [
|
||||||
'async' => 1,
|
'async' => true,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->assertEquals(401, $execution['headers']['status-code']);
|
$this->assertEquals(401, $execution['headers']['status-code']);
|
||||||
|
|
Loading…
Reference in a new issue