mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
chore(ci): run MongoDB only where tests need it
MariaDB, MongoDB and PostgreSQL had no compose profiles, so all three
database containers started on every test run -- the existing
COMPOSE_PROFILES values in CI were inert for them.
Gate MariaDB and MongoDB behind their own profiles in the dev/CI
override. PostgreSQL stays unprofiled because VectorsDB requires it
unconditionally. Profiles live only in the override, so the compose file
generated for self-hosted installs is unchanged.
DocumentsDB pools reject any non-MongoDB DSN, so Mongo still runs for
the four suites that exercise it, and in shared tables mode where boot
connects every pool. Everything else -- 24 service suites, unit, general
E2E, the grouped jobs and the benchmark -- now runs without it.
Two workers defaulted depends_on to ${_APP_DB_HOST:-mariadb} while the
rest of the file defaults to postgresql; with profiles active that stale
default is a hard failure, so align it and drop the now-dead
placeholders from the compose generator.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
5803c4e266
commit
e47ecd5c37
5 files changed
+28
-9
No files matched your search
@@ -36,6 +36,9 @@ _APP_CONSOLE_COUNTRIES_DENYLIST=AQ
|
||||
_APP_CONSOLE_WHITELIST_EMAILS=
|
||||
_APP_CONSOLE_WHITELIST_IPS=
|
||||
_APP_CONSOLE_WHITELIST_ROOT=disabled
|
||||
# MariaDB and MongoDB only start when their profile is listed here; PostgreSQL always
|
||||
# runs because VectorsDB requires it. MongoDB is on by default for DocumentsDB.
|
||||
COMPOSE_PROFILES=mongodb
|
||||
_APP_DB_ADAPTER=postgresql
|
||||
_APP_DB_HOST=postgresql
|
||||
_APP_DB_PORT=5432
|
||||
|
||||
@@ -196,7 +196,7 @@ jobs:
|
||||
{ name: 'Account', runner: runner4, functional: true, processes: null },
|
||||
{ name: 'Avatars', runner: runner4, functional: true, processes: null },
|
||||
{ name: 'Console', runner: runner4, functional: true, processes: null },
|
||||
{ name: 'Databases', runner: runner8, functional: false, processes: 3 },
|
||||
{ name: 'Databases', runner: runner8, functional: false, processes: 3, documentsdb: true },
|
||||
{ name: 'TablesDB', runner: runner8, functional: false, processes: 3 },
|
||||
{ name: 'Functions', runner: runner4, functional: false, processes: null },
|
||||
{ name: 'FunctionsSchedule', runner: runner4, functional: true, processes: null },
|
||||
@@ -204,8 +204,8 @@ jobs:
|
||||
{ name: 'Health', runner: runner4, functional: true, processes: null },
|
||||
{ name: 'Advisor', runner: runner4, functional: true, processes: null },
|
||||
{ name: 'Locale', runner: runner4, functional: true, processes: null },
|
||||
{ name: 'Projects', runner: runner4, functional: true, processes: null },
|
||||
{ name: 'Realtime', runner: runner4, functional: false, processes: null },
|
||||
{ name: 'Projects', runner: runner4, functional: true, processes: null, documentsdb: true },
|
||||
{ name: 'Realtime', runner: runner4, functional: false, processes: null, documentsdb: true },
|
||||
{ name: 'Sites', runner: runner4, functional: true, processes: null },
|
||||
{ name: 'Proxy', runner: runner4, functional: true, processes: null },
|
||||
{ name: 'Storage', runner: runner4, functional: true, processes: null },
|
||||
@@ -218,7 +218,7 @@ jobs:
|
||||
{ name: 'VCSGitea', runner: runner4, functional: false, processes: null },
|
||||
{ name: 'Messaging', runner: runner4, functional: true, processes: null },
|
||||
{ name: 'Notifications', runner: runner4, functional: true, processes: null },
|
||||
{ name: 'Migrations', runner: runner4, functional: true, processes: 1 },
|
||||
{ name: 'Migrations', runner: runner4, functional: true, processes: 1, documentsdb: true },
|
||||
{ name: 'Project', runner: runner4, functional: true, processes: null },
|
||||
{ name: 'Presences', runner: runner4, functional: true, processes: null },
|
||||
];
|
||||
@@ -298,6 +298,8 @@ jobs:
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
env:
|
||||
COMPOSE_PROFILES: ''
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
@@ -354,6 +356,8 @@ jobs:
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
env:
|
||||
COMPOSE_PROFILES: ''
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
@@ -452,6 +456,13 @@ jobs:
|
||||
echo "_APP_DB_PORT=5432" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
# DocumentsDB is MongoDB-only, so Mongo runs alongside another primary just for
|
||||
# the suites that use it, and in shared tables mode where boot connects every pool.
|
||||
if [ "${{ matrix.database }}" != "MongoDB" ] \
|
||||
&& { [ "${{ matrix.service.documentsdb }}" = "true" ] || [ "${{ matrix.mode }}" = "shared" ]; }; then
|
||||
COMPOSE_PROFILES="${COMPOSE_PROFILES},mongodb"
|
||||
fi
|
||||
|
||||
# Gitea runs alongside Appwrite only where VCS tests need it.
|
||||
if [ "${{ matrix.service.name }}" = "VCSGitea" ]; then
|
||||
COMPOSE_PROFILES="${COMPOSE_PROFILES},gitea"
|
||||
@@ -580,7 +591,8 @@ jobs:
|
||||
compose_profiles: antivirus
|
||||
wait: clamav
|
||||
env:
|
||||
COMPOSE_PROFILES: ${{ matrix.config.compose_profiles }}
|
||||
# Shared tables mode connects every pool at boot, including the MongoDB-only DocumentsDB.
|
||||
COMPOSE_PROFILES: ${{ matrix.mode == 'shared' && format('mongodb,{0}', matrix.config.compose_profiles) || matrix.config.compose_profiles }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
@@ -692,6 +704,8 @@ jobs:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
packages: read
|
||||
env:
|
||||
COMPOSE_PROFILES: ''
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
@@ -484,9 +484,13 @@ services:
|
||||
aliases:
|
||||
- appwrite.test
|
||||
mariadb:
|
||||
profiles:
|
||||
- mariadb
|
||||
ports:
|
||||
- "9510:3306"
|
||||
mongodb:
|
||||
profiles:
|
||||
- mongodb
|
||||
ports:
|
||||
- "9511:27017"
|
||||
postgresql:
|
||||
|
||||
+2
-2
@@ -751,7 +751,7 @@ services:
|
||||
- appwrite
|
||||
depends_on:
|
||||
- redis
|
||||
- ${_APP_DB_HOST:-mariadb}
|
||||
- ${_APP_DB_HOST:-postgresql}
|
||||
environment:
|
||||
- _APP_ENV
|
||||
- _APP_WORKERS_NUM=1
|
||||
@@ -796,7 +796,7 @@ services:
|
||||
- appwrite
|
||||
depends_on:
|
||||
- redis
|
||||
- ${_APP_DB_HOST:-mariadb}
|
||||
- ${_APP_DB_HOST:-postgresql}
|
||||
environment:
|
||||
- _APP_ENV
|
||||
- _APP_WORKER_PER_CORE
|
||||
|
||||
@@ -56,8 +56,6 @@ class Generator
|
||||
],
|
||||
'placeholders' => [
|
||||
'${_APP_DB_HOST:-postgresql}',
|
||||
'${_APP_DB_HOST:-mongodb}',
|
||||
'${_APP_DB_HOST:-mariadb}',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
Reference in new issue
Block a user