1
0
Fork 0
mirror of synced 2024-06-26 18:20:43 +12:00

fix: fix tests

This commit is contained in:
Christy Jacob 2022-02-21 16:46:40 +04:00
parent 1683ebb17b
commit dfd45a971b

View file

@ -7,6 +7,7 @@ use Tests\E2E\Client;
use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideServer;
use Utopia\CLI\Console;
class WebhooksCustomServerTest extends Scope
{
@ -398,12 +399,18 @@ class WebhooksCustomServerTest extends Scope
/**
* Test for SUCCESS
*/
$stderr = '';
$stdout= '';
$folder = 'timeout';
$code = realpath(__DIR__ . '/../../../resources/functions'). "/$folder/code.tar.gz";
Console::execute('cd '.realpath(__DIR__ . "/../../../resources/functions") . "/$folder && tar --exclude code.tar.gz -czf code.tar.gz .", '', $stdout, $stderr);
$deployment = $this->client->call(Client::METHOD_POST, '/functions/'.$data['functionId'].'/deployments', array_merge([
'content-type' => 'multipart/form-data',
'x-appwrite-project' => $this->getProject()['$id'],
], $this->getHeaders()), [
'entrypoint' => 'index.php',
'code' => new CURLFile(realpath(__DIR__ . '/../../../resources/functions/timeout.tar.gz'), 'application/x-gzip', 'php-fx.tar.gz'),
'code' => new CURLFile($code, 'application/x-gzip', \basename($code))
]);
$deploymentId = $deployment['body']['$id'] ?? '';