From 064ac2ccf88cb2389c5cc982d2ea477092e49087 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 4 Mar 2024 11:15:45 +0000 Subject: [PATCH 01/10] fix dsn in event test --- tests/unit/Event/EventTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/Event/EventTest.php b/tests/unit/Event/EventTest.php index a430a7fdc6..a84800a28e 100644 --- a/tests/unit/Event/EventTest.php +++ b/tests/unit/Event/EventTest.php @@ -30,7 +30,7 @@ class EventTest extends TestCase $dsn = App::getEnv('_APP_CONNECTIONS_QUEUE', $fallbackForRedis); $dsn = explode('=', $dsn); - $dsn = $dsn[0] ?? ''; + $dsn = $dsn[1] ?? ''; $dsn = new DSN($dsn); $connection = new Queue\Connection\Redis($dsn->getHost(), $dsn->getPort()); $this->queue = 'v1-tests' . uniqid(); From 86dc85f3a486e221a98e92e27bd4bd6da8f80fe8 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 4 Mar 2024 12:17:35 +0000 Subject: [PATCH 02/10] fix file path --- tests/e2e/Services/Databases/DatabasesBase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index dbb6d795c6..196199d602 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -4266,7 +4266,7 @@ trait DatabasesBase ], $this->getHeaders()), [ 'documentId' => ID::unique(), 'data' => [ - 'longtext' => file_get_contents('tests/resources/longtext.txt'), + 'longtext' => file_get_contents(__DIR__ . '/../../resources/longtext.txt'), ], 'permissions' => [ Permission::read(Role::user($this->getUser()['$id'])), From 060ec455b3948e6891e601d3e679c41dc39734f2 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 4 Mar 2024 12:44:40 +0000 Subject: [PATCH 03/10] fix --- tests/e2e/Services/Locale/LocaleBase.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/e2e/Services/Locale/LocaleBase.php b/tests/e2e/Services/Locale/LocaleBase.php index 17b5c66d67..872ec8449f 100644 --- a/tests/e2e/Services/Locale/LocaleBase.php +++ b/tests/e2e/Services/Locale/LocaleBase.php @@ -227,9 +227,9 @@ trait LocaleBase /** * Test for SUCCESS */ - $languages = require('app/config/locale/codes.php'); - $defaultCountries = require('app/config/locale/countries.php'); - $defaultContinents = require('app/config/locale/continents.php'); + $languages = require(__DIR__ . '/../../../../app/config/locale/codes.php'); + $defaultCountries = require(__DIR__ . '/../../../../app/config/locale/countries.php'); + $defaultContinents = require(__DIR__ . '/../../../../app/config/locale/continents.php'); foreach ($languages as $lang) { $response = $this->client->call(Client::METHOD_GET, '/locale/countries', [ From 5f4970befdcb812927c82a7aa41d6d6c4e19704d Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 4 Mar 2024 12:49:56 +0000 Subject: [PATCH 04/10] fix path --- tests/e2e/Services/Databases/DatabasesBase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index 196199d602..79a6c7a329 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -4266,7 +4266,7 @@ trait DatabasesBase ], $this->getHeaders()), [ 'documentId' => ID::unique(), 'data' => [ - 'longtext' => file_get_contents(__DIR__ . '/../../resources/longtext.txt'), + 'longtext' => file_get_contents(__DIR__ . '/../../../extensionsresources/longtext.txt'), ], 'permissions' => [ Permission::read(Role::user($this->getUser()['$id'])), From 5e6f53d6aa6fabd46b26e9e3cc1f527155b22259 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 4 Mar 2024 12:50:49 +0000 Subject: [PATCH 05/10] reclaim pool --- app/init.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/init.php b/app/init.php index 9696b08f6c..3cb9ffb2ad 100644 --- a/app/init.php +++ b/app/init.php @@ -1161,7 +1161,7 @@ App::setResource('dbForConsole', function (Group $pools, Cache $cache) { ->setMetadata('host', \gethostname()) ->setMetadata('project', 'console') ->setTimeout(APP_DATABASE_TIMEOUT_MILLISECONDS); - + $pools->get('console')->reclaim(); return $database; }, ['pools', 'cache']); From 57d7995e3653a89e26128d3017b8a40588048b8b Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 4 Mar 2024 12:58:28 +0000 Subject: [PATCH 06/10] fix file path --- .../Services/Projects/ProjectsConsoleClientTest.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php index 574ff7dcc5..869e0c3582 100644 --- a/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php +++ b/tests/e2e/Services/Projects/ProjectsConsoleClientTest.php @@ -798,7 +798,7 @@ class ProjectsConsoleClientTest extends Scope public function testUpdateProjectOAuth($data): array { $id = $data['projectId'] ?? ''; - $providers = require('app/config/providers.php'); + $providers = require(__DIR__ . '/../../../../app/config/providers.php'); /** * Test for SUCCESS @@ -909,7 +909,7 @@ class ProjectsConsoleClientTest extends Scope public function testUpdateProjectAuthStatus($data): array { $id = $data['projectId'] ?? ''; - $auth = require('app/config/auth.php'); + $auth = require(__DIR__ . '/../../../../app/config/auth.php'); $originalEmail = uniqid() . 'user@localhost.test'; $originalPassword = 'password'; @@ -1732,7 +1732,7 @@ class ProjectsConsoleClientTest extends Scope $this->assertNotEmpty($project['body']['$id']); $id = $project['body']['$id']; - $services = require('app/config/services.php'); + $services = require(__DIR__ . '/../../../../app/config/services.php'); /** * Test for Disabled @@ -1806,7 +1806,7 @@ class ProjectsConsoleClientTest extends Scope { $id = $data['projectId']; - $services = require('app/config/services.php'); + $services = require(__DIR__ . '/../../../../app/config/services.php'); /** * Test for Disabled @@ -1880,7 +1880,7 @@ class ProjectsConsoleClientTest extends Scope { $id = $data['projectId']; - $services = require('app/config/services.php'); + $services = require(__DIR__ . '/../../../../app/config/services.php'); /** * Test for Disabled From b409efc492cb68efae0d372f7c375e70e5a7b543 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 10 Mar 2024 08:01:10 +0000 Subject: [PATCH 07/10] fix path --- tests/e2e/Services/Databases/DatabasesBase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index 79a6c7a329..c09f9a1cc1 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -4266,7 +4266,7 @@ trait DatabasesBase ], $this->getHeaders()), [ 'documentId' => ID::unique(), 'data' => [ - 'longtext' => file_get_contents(__DIR__ . '/../../../extensionsresources/longtext.txt'), + 'longtext' => file_get_contents(__DIR__ . '/../../../resources/longtext.txt'), ], 'permissions' => [ Permission::read(Role::user($this->getUser()['$id'])), From 17d85a478ac199bf3ee7e5d3d740ad6188eb94d9 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Thu, 14 Mar 2024 01:18:17 +0000 Subject: [PATCH 08/10] fix event test dsn --- tests/unit/Event/EventTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/Event/EventTest.php b/tests/unit/Event/EventTest.php index a84800a28e..d8ce60a35f 100644 --- a/tests/unit/Event/EventTest.php +++ b/tests/unit/Event/EventTest.php @@ -28,7 +28,7 @@ class EventTest extends TestCase 'pass' => App::getEnv('_APP_REDIS_PASS', ''), ]); - $dsn = App::getEnv('_APP_CONNECTIONS_QUEUE', $fallbackForRedis); + $dsn = App::getEnv('_APP_CONNECTIONS_QUEUE', 'redis=' . $fallbackForRedis); $dsn = explode('=', $dsn); $dsn = $dsn[1] ?? ''; $dsn = new DSN($dsn); From 061368fae0fd5bb980cde785a66baa586a5ca615 Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Sun, 24 Mar 2024 12:09:30 +0545 Subject: [PATCH 09/10] Update init.php --- app/init.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/init.php b/app/init.php index 7868a1b584..354140f286 100644 --- a/app/init.php +++ b/app/init.php @@ -1161,7 +1161,6 @@ App::setResource('dbForConsole', function (Group $pools, Cache $cache) { ->setMetadata('host', \gethostname()) ->setMetadata('project', 'console') ->setTimeout(APP_DATABASE_TIMEOUT_MILLISECONDS); - $pools->get('console')->reclaim(); return $database; }, ['pools', 'cache']); From 7d68c12f1ba3d5887567078e08cabe978f773f7f Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Mon, 25 Mar 2024 11:35:28 +0545 Subject: [PATCH 10/10] Update init.php --- app/init.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/init.php b/app/init.php index 354140f286..cd97fba276 100644 --- a/app/init.php +++ b/app/init.php @@ -1161,6 +1161,7 @@ App::setResource('dbForConsole', function (Group $pools, Cache $cache) { ->setMetadata('host', \gethostname()) ->setMetadata('project', 'console') ->setTimeout(APP_DATABASE_TIMEOUT_MILLISECONDS); + return $database; }, ['pools', 'cache']);