Compare commits

..
Author SHA1 Message Date
loks0nandClaude Opus 4.6 286e0e5802 Fix import ordering in TablesDB test files
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 16:25:05 +00:00
loks0nandClaude Opus 4.6 ac05c9e9ce Split TablesDB e2e tests into a separate CI job
Move all TablesDB* test files from tests/e2e/Services/Databases/ to a
new tests/e2e/Services/TablesDB/ directory, updating namespaces and
adding explicit imports for shared base traits. Add TablesDB as a
separate service in the CI matrix so /v1/databases and /v1/tables tests
run as independent parallel jobs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 16:22:01 +00:00
14 changed files with 32 additions and 36 deletions
+2 -1
View File
@@ -332,6 +332,7 @@ jobs:
Avatars,
Console,
Databases,
TablesDB,
Functions,
FunctionsSchedule,
GraphQL,
@@ -420,7 +421,7 @@ jobs:
# Services that rely on sequential test method execution (shared static state)
FUNCTIONAL_FLAG="--functional"
case "${{ matrix.service }}" in
Databases|Functions|Realtime) FUNCTIONAL_FLAG="" ;;
Databases|TablesDB|Functions|Realtime) FUNCTIONAL_FLAG="" ;;
esac
docker compose exec -T \
+7 -23
View File
@@ -50,16 +50,6 @@ require_once __DIR__ . '/init.php';
Runtime::enableCoroutine(SWOOLE_HOOK_ALL);
// Log uncaught exceptions in one line instead of relying on Swoole's full backtrace dump
set_exception_handler(function (\Throwable $e) {
Console::error(sprintf(
'Realtime uncaught exception: %s in %s:%d',
$e->getMessage(),
$e->getFile(),
$e->getLine()
));
});
// Allows overriding
if (!function_exists('getConsoleDB')) {
function getConsoleDB(): Database
@@ -995,21 +985,15 @@ $server->onMessage(function (int $connection, string $message) use ($server, $re
});
$server->onClose(function (int $connection) use ($realtime, $stats, $register) {
try {
if (array_key_exists($connection, $realtime->connections)) {
$stats->decr($realtime->connections[$connection]['projectId'], 'connectionsTotal');
$register->get('telemetry.connectionCounter')->add(-1);
if (array_key_exists($connection, $realtime->connections)) {
$stats->decr($realtime->connections[$connection]['projectId'], 'connectionsTotal');
$register->get('telemetry.connectionCounter')->add(-1);
$projectId = $realtime->connections[$connection]['projectId'];
$projectId = $realtime->connections[$connection]['projectId'];
triggerStats([
METRIC_REALTIME_CONNECTIONS => -1,
], $projectId);
}
} catch (\Throwable $th) {
// Log only; do not rethrow. If we let this bubble, Swoole dumps full coroutine
// backtraces and unsubscribe() below would never run (connection cleanup would fail).
Console::error('Realtime onClose error: ' . $th->getMessage());
triggerStats([
METRIC_REALTIME_CONNECTIONS => -1,
], $projectId);
}
$realtime->unsubscribe($connection);
@@ -1,6 +1,6 @@
<?php
namespace Tests\E2E\Services\Databases\TablesDB;
namespace Tests\E2E\Services\TablesDB;
use Tests\E2E\Client;
use Tests\E2E\Scopes\ApiTablesDB;
@@ -1,6 +1,6 @@
<?php
namespace Tests\E2E\Services\Databases\Permissions;
namespace Tests\E2E\Services\TablesDB\Permissions;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\E2E\Client;
@@ -9,6 +9,7 @@ use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\SchemaPolling;
use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideClient;
use Tests\E2E\Services\Databases\Permissions\DatabasesPermissionsBase;
use Utopia\Database\Helpers\ID;
use Utopia\Database\Helpers\Permission;
use Utopia\Database\Helpers\Role;
@@ -1,6 +1,6 @@
<?php
namespace Tests\E2E\Services\Databases\Permissions;
namespace Tests\E2E\Services\TablesDB\Permissions;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\E2E\Client;
@@ -9,6 +9,7 @@ use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\SchemaPolling;
use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideClient;
use Tests\E2E\Services\Databases\Permissions\DatabasesPermissionsBase;
use Utopia\Database\Helpers\ID;
use Utopia\Database\Helpers\Permission;
use Utopia\Database\Helpers\Role;
@@ -1,6 +1,6 @@
<?php
namespace Tests\E2E\Services\Databases\Permissions;
namespace Tests\E2E\Services\TablesDB\Permissions;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\E2E\Client;
@@ -9,6 +9,7 @@ use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\SchemaPolling;
use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideClient;
use Tests\E2E\Services\Databases\Permissions\DatabasesPermissionsBase;
use Utopia\Database\Helpers\ID;
use Utopia\Database\Helpers\Permission;
use Utopia\Database\Helpers\Role;
@@ -1,11 +1,12 @@
<?php
namespace Tests\E2E\Services\Databases;
namespace Tests\E2E\Services\TablesDB;
use Tests\E2E\Scopes\ApiTablesDB;
use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideConsole;
use Tests\E2E\Services\Databases\DatabasesBase;
class TablesDBConsoleClientTest extends Scope
{
@@ -1,11 +1,12 @@
<?php
namespace Tests\E2E\Services\Databases;
namespace Tests\E2E\Services\TablesDB;
use Tests\E2E\Scopes\ApiTablesDB;
use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideClient;
use Tests\E2E\Services\Databases\DatabasesBase;
class TablesDBCustomClientTest extends Scope
{
@@ -1,11 +1,12 @@
<?php
namespace Tests\E2E\Services\Databases;
namespace Tests\E2E\Services\TablesDB;
use Tests\E2E\Scopes\ApiTablesDB;
use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideServer;
use Tests\E2E\Services\Databases\DatabasesBase;
class TablesDBCustomServerTest extends Scope
{
@@ -1,11 +1,12 @@
<?php
namespace Tests\E2E\Services\Databases\Transactions;
namespace Tests\E2E\Services\TablesDB\Transactions;
use Tests\E2E\Scopes\ApiTablesDB;
use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideClient;
use Tests\E2E\Services\Databases\Transactions\ACIDBase;
use Tests\E2E\Traits\DatabasesUrlHelpers;
class TablesDBACIDTest extends Scope
@@ -1,11 +1,12 @@
<?php
namespace Tests\E2E\Services\Databases\Transactions;
namespace Tests\E2E\Services\TablesDB\Transactions;
use Tests\E2E\Scopes\ApiTablesDB;
use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideClient;
use Tests\E2E\Services\Databases\Transactions\TransactionPermissionsBase;
class TablesDBTransactionPermissionsCustomClientTest extends Scope
{
@@ -1,11 +1,12 @@
<?php
namespace Tests\E2E\Services\Databases\Transactions;
namespace Tests\E2E\Services\TablesDB\Transactions;
use Tests\E2E\Scopes\ApiTablesDB;
use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideConsole;
use Tests\E2E\Services\Databases\Transactions\TransactionsBase;
use Tests\E2E\Traits\DatabasesUrlHelpers;
class TablesDBTransactionsConsoleClientTest extends Scope
@@ -1,11 +1,12 @@
<?php
namespace Tests\E2E\Services\Databases\Transactions;
namespace Tests\E2E\Services\TablesDB\Transactions;
use Tests\E2E\Scopes\ApiTablesDB;
use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideClient;
use Tests\E2E\Services\Databases\Transactions\TransactionsBase;
use Tests\E2E\Traits\DatabasesUrlHelpers;
class TablesDBTransactionsCustomClientTest extends Scope
@@ -1,11 +1,12 @@
<?php
namespace Tests\E2E\Services\Databases\Transactions;
namespace Tests\E2E\Services\TablesDB\Transactions;
use Tests\E2E\Scopes\ApiTablesDB;
use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideServer;
use Tests\E2E\Services\Databases\Transactions\TransactionsBase;
use Tests\E2E\Traits\DatabasesUrlHelpers;
class TablesDBTransactionsCustomServerTest extends Scope