1
0
Fork 0
mirror of synced 2024-06-29 11:40:45 +12:00

Fix unicode support and reenable tests

This commit is contained in:
Bradley Schofield 2022-04-27 13:57:03 +00:00
parent a18e9c4017
commit e694eb3b5c
5 changed files with 13 additions and 13 deletions

View file

@ -497,12 +497,12 @@ App::post('/v1/execution')
$functionStatus = ($statusCode >= 200 && $statusCode < 300) ? 'completed' : 'failed';
Console::success('Function executed in ' . $executionTime . ' seconds, status: ' . $functionStatus);
$execution = [
'status' => $functionStatus,
'statusCode' => $statusCode,
'stdout' => \mb_strcut(\utf8_encode($stdout), 0, 1000000), // Limit to 1MB
'stderr' => \mb_strcut(\utf8_encode($stderr), 0, 1000000), // Limit to 1MB
'stdout' => \mb_strcut($stdout, 0, 1000000), // Limit to 1MB
'stderr' => \mb_strcut($stderr, 0, 1000000), // Limit to 1MB
'time' => $executionTime,
];

12
composer.lock generated
View file

@ -2247,16 +2247,16 @@
},
{
"name": "utopia-php/framework",
"version": "0.19.7",
"version": "0.19.20",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/framework.git",
"reference": "f17afe77a21873b9be18ebc05283813468b4283a"
"reference": "65ced168db8f6e188ceeb0d101f57552c3d8b2af"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/framework/zipball/f17afe77a21873b9be18ebc05283813468b4283a",
"reference": "f17afe77a21873b9be18ebc05283813468b4283a",
"url": "https://api.github.com/repos/utopia-php/framework/zipball/65ced168db8f6e188ceeb0d101f57552c3d8b2af",
"reference": "65ced168db8f6e188ceeb0d101f57552c3d8b2af",
"shasum": ""
},
"require": {
@ -2290,9 +2290,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/framework/issues",
"source": "https://github.com/utopia-php/framework/tree/0.19.7"
"source": "https://github.com/utopia-php/framework/tree/0.19.20"
},
"time": "2022-02-18T00:04:49+00:00"
"time": "2022-04-14T15:42:37+00:00"
},
{
"name": "utopia-php/image",

View file

@ -513,7 +513,7 @@ class FunctionsCustomServerTest extends Scope
$this->assertStringContainsString('http', $execution['body']['stdout']);
$this->assertStringContainsString('PHP', $execution['body']['stdout']);
$this->assertStringContainsString('8.0', $execution['body']['stdout']);
// $this->assertStringContainsString('êä', $execution['body']['stdout']); // tests unknown utf-8 chars
$this->assertStringContainsString('êä', $execution['body']['stdout']); // tests unknown utf-8 chars
$this->assertEquals('', $execution['body']['stderr']);
$this->assertLessThan(0.500, $execution['body']['time']);
@ -601,7 +601,7 @@ class FunctionsCustomServerTest extends Scope
$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->assertStringContainsString('êä', $execution['body']['sdtout']); // tests unknown utf-8 chars
$this->assertLessThan(0.500, $execution['body']['time']);
return $data;

View file

@ -10,6 +10,6 @@ return function ($request, $response) {
'APPWRITE_FUNCTION_RUNTIME_VERSION' => $request['env']['APPWRITE_FUNCTION_RUNTIME_VERSION'],
'APPWRITE_FUNCTION_EVENT' => $request['env']['APPWRITE_FUNCTION_EVENT'],
'APPWRITE_FUNCTION_EVENT_DATA' => $request['env']['APPWRITE_FUNCTION_EVENT_DATA'],
'UNICODE_TEST' => "êä" // TODO: Re-add unicode test to FunctionsCustomServerTest.php
'UNICODE_TEST' => "êä"
]);
};

View file

@ -10,6 +10,6 @@ return function ($request, $response) {
'APPWRITE_FUNCTION_RUNTIME_VERSION' => $request['env']['APPWRITE_FUNCTION_RUNTIME_VERSION'],
'APPWRITE_FUNCTION_EVENT' => $request['env']['APPWRITE_FUNCTION_EVENT'],
'APPWRITE_FUNCTION_EVENT_DATA' => $request['env']['APPWRITE_FUNCTION_EVENT_DATA'],
'UNICODE_TEST' => "êä" // TODO: Re-add unicode test to FunctionsCustomServerTest.php
'UNICODE_TEST' => "êä"
]);
};