From 52981e0164f384dd2bf192acbfb5dfde38bf1bc9 Mon Sep 17 00:00:00 2001 From: Prem Palanisamy Date: Thu, 2 Apr 2026 10:05:30 +0200 Subject: [PATCH] fix: restore full CI matrix and revert test/endpoint changes to 1.9.x --- .github/workflows/ci.yml | 32 ++++++++++++++++--- .../Http/VectorsDB/Collections/Create.php | 8 +++-- tests/e2e/Scopes/Scope.php | 10 ------ .../DocumentsDB/DocumentsDBIndexTest.php | 6 ---- .../DocumentsDBConsoleClientTest.php | 6 ---- .../Databases/DocumentsDBCustomClientTest.php | 6 ---- .../Databases/DocumentsDBCustomServerTest.php | 6 ---- .../Databases/VectorsDB/DatabasesBase.php | 2 -- .../DatabasesPermissionsGuestTest.php | 6 ---- .../DatabasesPermissionsMemberTest.php | 6 ---- .../DatabasesPermissionsTeamTest.php | 6 ---- .../VectorsDB/Transactions/ACIDTest.php | 6 ---- .../TransactionsConsoleClientTest.php | 6 ---- .../TransactionsCustomClientTest.php | 6 ---- .../TransactionsCustomServerTest.php | 6 ---- .../Databases/VectorsDBConsoleClientTest.php | 6 ---- .../Databases/VectorsDBCustomClientTest.php | 6 ---- .../Databases/VectorsDBCustomServerTest.php | 6 ---- .../Services/Migrations/MigrationsBase.php | 23 ++----------- .../Realtime/RealtimeCustomClientTest.php | 4 --- 20 files changed, 35 insertions(+), 128 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 382896e867..b984fe1574 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -218,9 +218,8 @@ jobs: const decode = (content) => JSON.parse(Buffer.from(content, 'base64').toString()); const databaseChanged = getDbVersion(decode(base.content)) !== getDbVersion(decode(head.content)); - // TEMP: Only run failing combinations for debugging - core.setOutput('databases', JSON.stringify(allDatabases)); - core.setOutput('modes', JSON.stringify(allModes)); + core.setOutput('databases', JSON.stringify(databaseChanged ? allDatabases : defaultDatabases)); + core.setOutput('modes', JSON.stringify(databaseChanged ? allModes : defaultModes)); build: name: Build @@ -380,7 +379,32 @@ jobs: matrix: database: ${{ fromJSON(needs.matrix.outputs.databases) }} mode: ${{ fromJSON(needs.matrix.outputs.modes) }} - service: [Realtime, Migrations, Projects, Databases, TablesDB] + service: [ + Account, + Avatars, + Console, + Databases, + TablesDB, + Functions, + FunctionsSchedule, + GraphQL, + Health, + Locale, + Projects, + Realtime, + Sites, + Proxy, + Storage, + Tokens, + Teams, + Users, + ProjectWebhooks, + Webhooks, + VCS, + Messaging, + Migrations, + Project + ] include: - service: Databases runner: blacksmith-4vcpu-ubuntu-2404 diff --git a/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Create.php index af8b140421..a7e2d68eac 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/VectorsDB/Collections/Create.php @@ -130,9 +130,11 @@ class Create extends CollectionAction $indexes[] = new Document($index); } try { - try { - $dbForDatabases->create(); - } catch (DuplicateException) { + if (!$dbForDatabases->exists(null, Database::METADATA)) { + try { + $dbForDatabases->create(); + } catch (DuplicateException) { + } } $dbForDatabases->createCollection( id: 'database_' . $database->getSequence() . '_collection_' . $collection->getSequence(), diff --git a/tests/e2e/Scopes/Scope.php b/tests/e2e/Scopes/Scope.php index f9c838466a..8c62c0c14a 100644 --- a/tests/e2e/Scopes/Scope.php +++ b/tests/e2e/Scopes/Scope.php @@ -43,16 +43,6 @@ abstract class Scope extends TestCase $this->client = null; } - /** - * Skip test if the current database adapter doesn't match the required one. - */ - protected function requireAdapter(string $adapter): void - { - if (\getenv('_APP_DB_ADAPTER') !== $adapter) { - $this->markTestSkipped("Requires {$adapter} adapter"); - } - } - /** * @var array|null Cached console variables */ diff --git a/tests/e2e/Services/Databases/DocumentsDB/DocumentsDBIndexTest.php b/tests/e2e/Services/Databases/DocumentsDB/DocumentsDBIndexTest.php index 86fc9f9ff5..1fdcc84d0c 100644 --- a/tests/e2e/Services/Databases/DocumentsDB/DocumentsDBIndexTest.php +++ b/tests/e2e/Services/Databases/DocumentsDB/DocumentsDBIndexTest.php @@ -13,12 +13,6 @@ class DocumentsDBIndexTest extends Scope use ProjectCustom; use SideServer; - protected function setUp(): void - { - parent::setUp(); - $this->requireAdapter('mongodb'); - } - public function testCreateIndexes(): void { $database = $this->client->call( diff --git a/tests/e2e/Services/Databases/DocumentsDBConsoleClientTest.php b/tests/e2e/Services/Databases/DocumentsDBConsoleClientTest.php index 7a8e29b9c6..895cf67490 100644 --- a/tests/e2e/Services/Databases/DocumentsDBConsoleClientTest.php +++ b/tests/e2e/Services/Databases/DocumentsDBConsoleClientTest.php @@ -13,10 +13,4 @@ class DocumentsDBConsoleClientTest extends Scope use ProjectCustom; use SideConsole; use ApiDocumentsDB; - - protected function setUp(): void - { - parent::setUp(); - $this->requireAdapter('mongodb'); - } } diff --git a/tests/e2e/Services/Databases/DocumentsDBCustomClientTest.php b/tests/e2e/Services/Databases/DocumentsDBCustomClientTest.php index 94b4bc4011..4a2713bcb5 100644 --- a/tests/e2e/Services/Databases/DocumentsDBCustomClientTest.php +++ b/tests/e2e/Services/Databases/DocumentsDBCustomClientTest.php @@ -13,10 +13,4 @@ class DocumentsDBCustomClientTest extends Scope use ProjectCustom; use SideClient; use ApiDocumentsDB; - - protected function setUp(): void - { - parent::setUp(); - $this->requireAdapter('mongodb'); - } } diff --git a/tests/e2e/Services/Databases/DocumentsDBCustomServerTest.php b/tests/e2e/Services/Databases/DocumentsDBCustomServerTest.php index 016bc8925c..a235924dfc 100644 --- a/tests/e2e/Services/Databases/DocumentsDBCustomServerTest.php +++ b/tests/e2e/Services/Databases/DocumentsDBCustomServerTest.php @@ -13,10 +13,4 @@ class DocumentsDBCustomServerTest extends Scope use ProjectCustom; use SideServer; use ApiDocumentsDB; - - protected function setUp(): void - { - parent::setUp(); - $this->requireAdapter('mongodb'); - } } diff --git a/tests/e2e/Services/Databases/VectorsDB/DatabasesBase.php b/tests/e2e/Services/Databases/VectorsDB/DatabasesBase.php index 7eafe559d6..1bdc77085b 100644 --- a/tests/e2e/Services/Databases/VectorsDB/DatabasesBase.php +++ b/tests/e2e/Services/Databases/VectorsDB/DatabasesBase.php @@ -14,8 +14,6 @@ trait DatabasesBase { public function testCreateDatabase(): array { - $this->requireAdapter('postgresql'); - /** * Test for SUCCESS */ diff --git a/tests/e2e/Services/Databases/VectorsDB/Permissions/DatabasesPermissionsGuestTest.php b/tests/e2e/Services/Databases/VectorsDB/Permissions/DatabasesPermissionsGuestTest.php index acf63b13f0..9335b7f55b 100644 --- a/tests/e2e/Services/Databases/VectorsDB/Permissions/DatabasesPermissionsGuestTest.php +++ b/tests/e2e/Services/Databases/VectorsDB/Permissions/DatabasesPermissionsGuestTest.php @@ -18,12 +18,6 @@ class DatabasesPermissionsGuestTest extends Scope use SideClient; use DatabasesPermissionsScope; - protected function setUp(): void - { - parent::setUp(); - $this->requireAdapter('postgresql'); - } - private $authorization; public function getAuthorization(): Authorization diff --git a/tests/e2e/Services/Databases/VectorsDB/Permissions/DatabasesPermissionsMemberTest.php b/tests/e2e/Services/Databases/VectorsDB/Permissions/DatabasesPermissionsMemberTest.php index 7be97f37d3..cbc2add857 100644 --- a/tests/e2e/Services/Databases/VectorsDB/Permissions/DatabasesPermissionsMemberTest.php +++ b/tests/e2e/Services/Databases/VectorsDB/Permissions/DatabasesPermissionsMemberTest.php @@ -18,12 +18,6 @@ class DatabasesPermissionsMemberTest extends Scope use SideClient; use DatabasesPermissionsScope; - protected function setUp(): void - { - parent::setUp(); - $this->requireAdapter('postgresql'); - } - public array $collections = []; public function createUsers(): array diff --git a/tests/e2e/Services/Databases/VectorsDB/Permissions/DatabasesPermissionsTeamTest.php b/tests/e2e/Services/Databases/VectorsDB/Permissions/DatabasesPermissionsTeamTest.php index 606db172c4..4091ea7140 100644 --- a/tests/e2e/Services/Databases/VectorsDB/Permissions/DatabasesPermissionsTeamTest.php +++ b/tests/e2e/Services/Databases/VectorsDB/Permissions/DatabasesPermissionsTeamTest.php @@ -18,12 +18,6 @@ class DatabasesPermissionsTeamTest extends Scope use SideClient; use DatabasesPermissionsScope; - protected function setUp(): void - { - parent::setUp(); - $this->requireAdapter('postgresql'); - } - public array $collections = []; public string $databaseId = 'testpermissiondb'; diff --git a/tests/e2e/Services/Databases/VectorsDB/Transactions/ACIDTest.php b/tests/e2e/Services/Databases/VectorsDB/Transactions/ACIDTest.php index f8bc5784e2..aa8d87eb8e 100644 --- a/tests/e2e/Services/Databases/VectorsDB/Transactions/ACIDTest.php +++ b/tests/e2e/Services/Databases/VectorsDB/Transactions/ACIDTest.php @@ -15,12 +15,6 @@ class ACIDTest extends Scope use ProjectCustom; use SideClient; - protected function setUp(): void - { - parent::setUp(); - $this->requireAdapter('postgresql'); - } - private function generateEmbeddings(int $dimensions = 3, float $value = 0.1): array { $vector = array_fill(0, $dimensions, $value); diff --git a/tests/e2e/Services/Databases/VectorsDB/Transactions/TransactionsConsoleClientTest.php b/tests/e2e/Services/Databases/VectorsDB/Transactions/TransactionsConsoleClientTest.php index 5340a05411..40ff27c572 100644 --- a/tests/e2e/Services/Databases/VectorsDB/Transactions/TransactionsConsoleClientTest.php +++ b/tests/e2e/Services/Databases/VectorsDB/Transactions/TransactionsConsoleClientTest.php @@ -11,10 +11,4 @@ class TransactionsConsoleClientTest extends Scope use TransactionsBase; use ProjectCustom; use SideConsole; - - protected function setUp(): void - { - parent::setUp(); - $this->requireAdapter('postgresql'); - } } diff --git a/tests/e2e/Services/Databases/VectorsDB/Transactions/TransactionsCustomClientTest.php b/tests/e2e/Services/Databases/VectorsDB/Transactions/TransactionsCustomClientTest.php index fe5a3a1e93..f9eca0e476 100644 --- a/tests/e2e/Services/Databases/VectorsDB/Transactions/TransactionsCustomClientTest.php +++ b/tests/e2e/Services/Databases/VectorsDB/Transactions/TransactionsCustomClientTest.php @@ -11,10 +11,4 @@ class TransactionsCustomClientTest extends Scope use TransactionsBase; use ProjectCustom; use SideClient; - - protected function setUp(): void - { - parent::setUp(); - $this->requireAdapter('postgresql'); - } } diff --git a/tests/e2e/Services/Databases/VectorsDB/Transactions/TransactionsCustomServerTest.php b/tests/e2e/Services/Databases/VectorsDB/Transactions/TransactionsCustomServerTest.php index be5456254e..29e4b9454b 100644 --- a/tests/e2e/Services/Databases/VectorsDB/Transactions/TransactionsCustomServerTest.php +++ b/tests/e2e/Services/Databases/VectorsDB/Transactions/TransactionsCustomServerTest.php @@ -11,10 +11,4 @@ class TransactionsCustomServerTest extends Scope use TransactionsBase; use ProjectCustom; use SideServer; - - protected function setUp(): void - { - parent::setUp(); - $this->requireAdapter('postgresql'); - } } diff --git a/tests/e2e/Services/Databases/VectorsDBConsoleClientTest.php b/tests/e2e/Services/Databases/VectorsDBConsoleClientTest.php index 05e39354af..80c2bc9d5c 100644 --- a/tests/e2e/Services/Databases/VectorsDBConsoleClientTest.php +++ b/tests/e2e/Services/Databases/VectorsDBConsoleClientTest.php @@ -17,12 +17,6 @@ class VectorsDBConsoleClientTest extends Scope use ProjectCustom; use SideConsole; - protected function setUp(): void - { - parent::setUp(); - $this->requireAdapter('postgresql'); - } - public function testCreateCollection(): array { $database = $this->client->call(Client::METHOD_POST, '/vectorsdb', array_merge([ diff --git a/tests/e2e/Services/Databases/VectorsDBCustomClientTest.php b/tests/e2e/Services/Databases/VectorsDBCustomClientTest.php index 52ec3f3f25..7add5c7f71 100644 --- a/tests/e2e/Services/Databases/VectorsDBCustomClientTest.php +++ b/tests/e2e/Services/Databases/VectorsDBCustomClientTest.php @@ -17,12 +17,6 @@ class VectorsDBCustomClientTest extends Scope use ProjectCustom; use SideClient; - protected function setUp(): void - { - parent::setUp(); - $this->requireAdapter('postgresql'); - } - public function testAllowedPermissions(): void { /** diff --git a/tests/e2e/Services/Databases/VectorsDBCustomServerTest.php b/tests/e2e/Services/Databases/VectorsDBCustomServerTest.php index 134c9c3fe5..ceb672443e 100644 --- a/tests/e2e/Services/Databases/VectorsDBCustomServerTest.php +++ b/tests/e2e/Services/Databases/VectorsDBCustomServerTest.php @@ -19,12 +19,6 @@ class VectorsDBCustomServerTest extends Scope use ProjectCustom; use SideServer; - protected function setUp(): void - { - parent::setUp(); - $this->requireAdapter('postgresql'); - } - public function testListDatabases(): array { $db1 = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ diff --git a/tests/e2e/Services/Migrations/MigrationsBase.php b/tests/e2e/Services/Migrations/MigrationsBase.php index 662543949a..9e9ce2fbcd 100644 --- a/tests/e2e/Services/Migrations/MigrationsBase.php +++ b/tests/e2e/Services/Migrations/MigrationsBase.php @@ -2561,8 +2561,6 @@ trait MigrationsBase */ public function testImportVectordbCSV(): void { - $this->requireAdapter('postgresql'); - $databaseId = null; $collectionId = null; $bucketId = null; @@ -2687,8 +2685,6 @@ trait MigrationsBase #[Retry(count: 1)] public function testExportVectordbCSV(): void { - $this->requireAdapter('postgresql'); - $databaseId = null; try { @@ -2821,8 +2817,6 @@ trait MigrationsBase */ public function testAppwriteMigrationDocumentsDBDatabase(): array { - $this->requireAdapter('mongodb'); - $response = $this->client->call(Client::METHOD_POST, '/documentsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -2885,8 +2879,6 @@ trait MigrationsBase */ public function testAppwriteMigrationVectorsDBDatabase(): array { - $this->requireAdapter('postgresql'); - $response = $this->client->call(Client::METHOD_POST, '/vectorsdb', [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -3207,8 +3199,6 @@ trait MigrationsBase */ public function testAppwriteMigrationMixedDatabases(): void { - $this->requireAdapter('mongodb'); - // Create a fresh isolated source project for this test $sourceProject = $this->getProject(true); @@ -4217,10 +4207,9 @@ trait MigrationsBase }, 30_000, 500); // Check that email was sent with download link - $lastEmail = $this->getLastEmail(probe: function ($email) { - $this->assertEquals('Your JSON export is ready', $email['subject']); - }); + $lastEmail = $this->getLastEmail(); $this->assertNotEmpty($lastEmail); + $this->assertEquals('Your JSON export is ready', $lastEmail['subject']); $this->assertStringContainsStringIgnoringCase('Your data export has been completed successfully', $lastEmail['text']); // Extract download URL from email HTML @@ -4261,8 +4250,6 @@ trait MigrationsBase public function testCreateVectorsDBJSONExport(): void { - $this->requireAdapter('postgresql'); - $headers = [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -4327,8 +4314,6 @@ trait MigrationsBase public function testCreateVectorsDBJSONImport(): void { - $this->requireAdapter('postgresql'); - $headers = [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -4409,8 +4394,6 @@ trait MigrationsBase public function testCreateDocumentsDBJSONExport(): void { - $this->requireAdapter('mongodb'); - $headers = [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], @@ -4475,8 +4458,6 @@ trait MigrationsBase public function testCreateDocumentsDBJSONImport(): void { - $this->requireAdapter('mongodb'); - $headers = [ 'content-type' => 'application/json', 'x-appwrite-project' => $this->getProject()['$id'], diff --git a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php index ebf3486582..03723bf231 100644 --- a/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php +++ b/tests/e2e/Services/Realtime/RealtimeCustomClientTest.php @@ -4598,8 +4598,6 @@ class RealtimeCustomClientTest extends Scope } public function testChannelDocumentsdb() { - $this->requireAdapter('mongodb'); - $user = $this->getUser(); $session = $user['session'] ?? ''; $projectId = $this->getProject()['$id']; @@ -5078,8 +5076,6 @@ class RealtimeCustomClientTest extends Scope public function testChannelVectorsDB() { - $this->requireAdapter('postgresql'); - $user = $this->getUser(); $session = $user['session'] ?? ''; $projectId = $this->getProject()['$id'];