feat: fix tests

This commit is contained in:
Christy Jacob
2022-02-24 21:00:05 +04:00
parent fcb2fafbf0
commit 8d0ff927a7
4 changed files with 7 additions and 10 deletions
-1
View File
@@ -942,7 +942,6 @@ App::post('/v1/functions/:functionId/executions')
try {
$executionResponse = $executor->createExecution(
projectId: $project->getId(),
functionId: $function->getId(),
deploymentId: $deployment->getId(),
path: $build->getAttribute('outputPath', ''),
vars: $vars,
-2
View File
@@ -36,7 +36,6 @@ class Executor
*
* Launches a runtime container for a deployment ready for execution
*
* @param string $functionId
* @param string $deploymentId
* @param string $projectId
* @param string $source
@@ -126,7 +125,6 @@ class Executor
* Create an execution
*
* @param string $projectId
* @param string $functionId
* @param string $deploymentId
* @param string $path
* @param array $vars
@@ -383,7 +383,7 @@ class FunctionsCustomClientTest extends Scope
'async' => false
]);
$output = json_decode($execution['body']['response'], true);
$output = json_decode($execution['body']['stdout'], true);
$this->assertEquals(201, $execution['headers']['status-code']);
$this->assertEquals('completed', $execution['body']['status']);
$this->assertEquals($functionId, $output['APPWRITE_FUNCTION_ID']);
@@ -594,12 +594,12 @@ class FunctionsCustomServerTest extends Scope
]);
$this->assertEquals('completed', $execution['body']['status']);
$this->assertStringContainsString($data['deploymentId'], $execution['body']['response']);
$this->assertStringContainsString('Test1', $execution['body']['response']);
$this->assertStringContainsString('http', $execution['body']['response']);
$this->assertStringContainsString('PHP', $execution['body']['response']);
$this->assertStringContainsString('8.0', $execution['body']['response']);
// $this->assertStringContainsString('êä', $execution['body']['response']); // tests unknown utf-8 chars
$this->assertStringContainsString($data['deploymentId'], $execution['body']['stdout']);
$this->assertStringContainsString('Test1', $execution['body']['stdout']);
$this->assertStringContainsString('http', $execution['body']['stdout']);
$this->assertStringContainsString('PHP', $execution['body']['stdout']);
$this->assertStringContainsString('8.0', $execution['body']['stdout']);
// $this->assertStringContainsString('êä', $execution['body']['sdtout']); // tests unknown utf-8 chars
$this->assertLessThan(0.500, $execution['body']['time']);
return $data;