mirror of
https://github.com/appwrite/appwrite
synced 2026-05-22 16:38:32 +00:00
test: Functions tests
This commit is contained in:
parent
5ac5baca38
commit
321f621132
4 changed files with 7 additions and 13 deletions
12
app/cli.php
12
app/cli.php
|
|
@ -25,7 +25,6 @@ Runtime::enableCoroutine(SWOOLE_HOOK_ALL);
|
|||
* @var Registry $global
|
||||
* @var Container $container
|
||||
*/
|
||||
$auth = new Dependency();
|
||||
$register = new Dependency();
|
||||
$logError = new Dependency();
|
||||
$queueForDeletes = new Dependency();
|
||||
|
|
@ -93,11 +92,6 @@ $logError
|
|||
});
|
||||
|
||||
|
||||
$auth
|
||||
->setName('auth')
|
||||
->setCallback(fn () => new Authorization());
|
||||
|
||||
$container->set($auth);
|
||||
$container->set($logError);
|
||||
$container->set($register);
|
||||
$container->set($queueForDeletes);
|
||||
|
|
@ -110,9 +104,9 @@ $cli = $platform->getCli();
|
|||
|
||||
$cli
|
||||
->init()
|
||||
->inject('auth')
|
||||
->action(function (Authorization $auth) {
|
||||
$auth->disable();
|
||||
->inject('authorization')
|
||||
->action(function (Authorization $authorization) {
|
||||
$authorization->disable();
|
||||
});
|
||||
|
||||
$cli
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
require_once __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use PHPMailer\PHPMailer\PHPMailer;
|
||||
use Redis;
|
||||
use Utopia\Cache\Adapter\Redis as CacheRedis;
|
||||
use Utopia\Cache\Adapter\Sharding;
|
||||
use Utopia\VCS\Adapter\Git\GitHub;
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ class Migrate extends Action
|
|||
->inject('dbForConsole')
|
||||
->inject('getProjectDB')
|
||||
->inject('register')
|
||||
->inject('auth')
|
||||
->callback(fn ($version, $cache, $dbForConsole, $getProjectDB, Registry $register, Authorization $auth) => $this->action($version, $cache, $dbForConsole, $getProjectDB, $register, $auth));
|
||||
->inject('authorization')
|
||||
->callback(fn ($version, $cache, $dbForConsole, $getProjectDB, Registry $register, Authorization $authorization) => $this->action($version, $cache, $dbForConsole, $getProjectDB, $register, $authorization));
|
||||
}
|
||||
|
||||
private function clearProjectsCache(Cache $cache, Document $project)
|
||||
|
|
|
|||
|
|
@ -164,7 +164,8 @@ class FunctionsCustomClientTest extends Scope
|
|||
$this->assertEquals(202, $execution['headers']['status-code']);
|
||||
|
||||
// Wait for the first scheduled execution to be created
|
||||
sleep(65);
|
||||
// Longer waiting time to cover all use-cases
|
||||
sleep(119);
|
||||
|
||||
$executions = $this->client->call(Client::METHOD_GET, '/functions/' . $function['body']['$id'] . '/executions', [
|
||||
'content-type' => 'application/json',
|
||||
|
|
|
|||
Loading…
Reference in a new issue