test: Functions tests

This commit is contained in:
Binyamin Yawitz 2024-06-07 12:13:12 -04:00
parent 5ac5baca38
commit 321f621132
No known key found for this signature in database
4 changed files with 7 additions and 13 deletions

View file

@ -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

View file

@ -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;

View file

@ -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)

View file

@ -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',