429 Commits

Author SHA1 Message Date
Jake Barnby 3306a03e8e chore: add 5-minute retry wait to reduce CI resource contention
With 120+ jobs starting simultaneously, transient failures are common
due to resource contention. Adding retry_wait_seconds: 300 to all
php-retry action usages gives the CI environment time to settle
before retrying failed tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 19:07:42 +13:00
Jake Barnby e69c1ddc7f fix: add executor readiness check to Site Screenshots CI jobs
The Site Screenshots CI jobs were missing the "Wait for Open Runtimes"
step that other E2E test jobs have, causing deployments to fail with
"Failed to connect to exc1 port 80" when the executor wasn't ready yet.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 17:37:15 +13:00
Jake Barnby bada1a7c05 Timing updates 2026-02-24 14:00:07 +13:00
Jake Barnby f2759cb65a fix: remove file caching, disable --functional for Databases/Functions/Realtime
Services that depend on shared static state between test methods
(Databases, Functions, Realtime) now run without --functional flag,
so test methods execute sequentially within each class while classes
still run in parallel. All other services keep --functional mode.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 03:44:28 +13:00
Jake Barnby 3ea1e8e59f fix: add file-based cross-process caching for ParaTest --functional mode
With --functional mode, each test method runs in its own process so
static caches are empty. This causes every method to recreate projects,
databases, collections, attributes, and indexes - flooding the serial
database worker queue and causing attribute polling timeouts.

File-based caching with file locks ensures resources are created once
per test class, then shared across all method processes. This restores
--functional mode and dramatically reduces worker queue load.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 01:47:20 +13:00
Jake Barnby 8be633a140 fix: remove --functional from paratest to use class-level parallelism
With --functional mode, every test method gets its own process with no
static cache sharing. This causes each method to independently create
databases, collections, and attributes, flooding the serial database
worker queue. Without --functional, each test class shares static caches
between methods, dramatically reducing schema operation count.

Also reverts _APP_WORKERS_NUM change since worker must remain serial.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 00:38:39 +13:00
Jake Barnby 0b7c8865f5 fix: increase E2E test timeout from 30 to 40 minutes
Database tests (PostgreSQL, Shared V1, Shared V2) consistently take
31-32 minutes, just exceeding the 30-minute timeout. Increase to 40
minutes for all E2E service tests to prevent false timeout failures.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 04:19:44 +13:00
Jake Barnby 2a535a2adc fix: exclude ciIgnore tests from CI and increase Realtime polling timeouts
- Add --exclude-group ciIgnore to paratest commands in tests.yml
  (the @group ciIgnore annotation was defined but never excluded)
- Increase attribute/index polling timeouts in RealtimeConsoleClientTest
  from 15s to 120s for Shared V2 stability

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 03:10:56 +13:00
Jake Barnby 8a6ddeef30 Merge branch '1.8.x' into feat-mongodb 2026-02-20 01:33:02 +13:00
Chirag Aggarwal 74c8be3fad fix workflow 2026-02-18 17:30:17 +05:30
Jake Barnby ce64011551 Merge branch '1.8.x' into feat-mongodb 2026-02-18 08:42:56 +00:00
Jake Barnby 0d1a6e07b4 fix: use relative path for --log-junit so retry action can find JUnit XML
The retry action couldn't extract the container name from docker compose
exec commands to copy the JUnit XML. Using a relative path works because
CWD inside the container is /usr/src/code and the volume mount
./tests:/usr/src/code/tests makes the file accessible at the same
relative path on both container and host.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 20:30:48 +13:00
Jake Barnby 93bc3871df fix: MongoDB test compatibility and enable JUnit XML for paratest retry
- testCreateIndexes: conditionally check index length based on adapter's maxIndexLength (MongoDB 1024 vs SQL 768)
- testConcurrentTransactionConflicts: accept both 409 and 500 since MongoDB adapter doesn't map write conflicts to ConflictException
- testEnforceCollectionPermissions: add error body to assertion for debugging
- Enable --log-junit for paratest in both project and shared mode CI jobs so itznotabug/php-retry@v3 can identify and selectively retry failing tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 19:09:01 +13:00
Jake Barnby a70e94a67b fix: resolve merge corruption in tests.yml workflow
The e2e_service_test job's command block had corrupted shell syntax from
a bad merge - orphaned elif/else without matching if, and duplicate
if-elif blocks for DB adapter env vars. The set-db-env step already sets
these via GITHUB_ENV, making the inline exports redundant.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 13:41:08 +13:00
Chirag Aggarwal 764f4dc563 ci: add workflow_dispatch GitHub Action for specs generation
Allows manually triggering spec generation from the Actions tab with
version selection and optional push to appwrite/specs repo.
2026-02-17 23:10:30 +05:30
Jake Barnby 64a368ba3d Merge remote-tracking branch 'origin/feat-db-tests' into feat-mongodb
# Conflicts:
#	.github/workflows/tests.yml
#	src/Appwrite/Utopia/Response.php
#	src/Appwrite/Utopia/Response/Model/AttributeList.php
#	tests/e2e/Client.php
#	tests/e2e/Scopes/ProjectCustom.php
#	tests/e2e/Services/Databases/DatabasesBase.php
#	tests/e2e/Services/Databases/Legacy/DatabasesCustomClientTest.php
#	tests/e2e/Services/Databases/Legacy/DatabasesCustomServerTest.php
#	tests/e2e/Services/Databases/Legacy/DatabasesStringTypesTest.php
#	tests/e2e/Services/Databases/TablesDB/DatabasesBase.php
#	tests/e2e/Services/Databases/TablesDB/DatabasesCustomClientTest.php
#	tests/e2e/Services/Databases/TablesDB/DatabasesCustomServerTest.php
#	tests/e2e/Services/Databases/TablesDB/DatabasesStringTypesTest.php
#	tests/e2e/Services/Databases/Transactions/TransactionsBase.php
#	tests/e2e/Services/GraphQL/Legacy/DatabaseServerTest.php
#	tests/e2e/Services/GraphQL/TablesDB/DatabaseServerTest.php
#	tests/e2e/Services/Messaging/MessagingBase.php
#	tests/e2e/Services/Sites/SitesBase.php
#	tests/e2e/Services/Sites/SitesCustomServerTest.php
2026-02-18 03:27:23 +13:00
Jake Barnby 436ced3f1f Merge branch '1.8.x' into feat-mongodb 2026-02-16 09:13:34 +00:00
Luke B. Silver a151959903 Merge branch '1.8.x' into ci/remove-stave-state 2026-02-13 20:54:56 +00:00
loks0n baa6599cef ci: upgrade docker/login-action from v2 to v3
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 20:53:56 +00:00
Jake Barnby 75ac4e4447 Merge branch '1.8.x' into feat-db-tests 2026-02-13 04:00:43 +00:00
Jake Barnby 9c40d0c6f8 Merge pull request #11317 from appwrite/copilot/sub-pr-11312 2026-02-13 03:02:25 +00:00
Jake Barnby 2b536078bb Merge branch '1.8.x' into feat-mongodb 2026-02-13 02:19:37 +00:00
copilot-swe-agent[bot] 3d58ed10dc Use explicit empty strings for environment variables
Co-authored-by: abnegate <5857008+abnegate@users.noreply.github.com>
2026-02-13 02:06:37 +00:00
copilot-swe-agent[bot] 0a79370e1c Use GitHub Actions env config instead of sed commands
Co-authored-by: abnegate <5857008+abnegate@users.noreply.github.com>
2026-02-13 02:05:30 +00:00
loks0n 4326600751 Refactor CI workflows: add COMPOSE_FILE env, add build targets, bump action versions, pin composer
- Add COMPOSE_FILE=docker-compose.yml to tests, benchmark, and sdk-preview to prevent loading overrides in CI
- Add target: development to tests/benchmark builds, target: production to pr-scan/nightly builds
- Bump actions/checkout v4→v6, docker/build-push-action v4/v5→v6, actions/upload-artifact v4→v6, actions/github-script v7→v8
- Pin composer images to 2.8 in linter and static-analysis workflows

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 00:56:03 +00:00
Jake Barnby f0e6105ba0 fix: Use Docker Compose profiles to isolate database containers in CI
- Add profiles to database services (mariadb, mongodb, postgresql) so only
  the needed database starts per CI job, freeing resources for the executor
- Increase Sites deployment activation timeouts from 50-100s to 200s for
  MongoDB compatibility
- Increase SSR logs polling timeout from 30s to 120s

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 07:27:21 +13:00
Jake Barnby eaff193055 fix: Resolve PostgreSQL DNS failure by routing through Docker's embedded DNS
The appwrite container's `dns: 172.16.238.100` (CoreDNS) bypassed Docker's
embedded DNS, preventing resolution of service names like `postgresql`.
CoreDNS only handles custom test domains and forwards unknown queries to
Cloudflare, which can't resolve Docker service names.

Fix: Add 127.0.0.11 (Docker embedded DNS) as primary resolver and configure
CoreDNS to forward unknown queries to Docker DNS with Cloudflare as fallback.
Bind CoreDNS to its static IP to avoid port conflict with Docker's DNS proxy.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 04:02:31 +13:00
Jake Barnby fc893e1c7e fix: Add connect_timeout to PostgreSQL DSN and add server logs to CI
PDO ATTR_TIMEOUT does not control connection timeout for the pgsql driver.
Without connect_timeout in the DSN, the PDO constructor blocks indefinitely
if PostgreSQL isn't ready, which blocks the Swoole master process event loop
(since coroutine hooks are not enabled in http.php) and prevents all HTTP
request dispatching.

Also add appwrite server logs to CI failure output for debugging.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 03:17:48 +13:00
Jake Barnby ccb8b9eb6f Revert "fix: Set MariaDB adapter for non-adapter-specific CI tests"
This reverts commit 17d9a72922.
2026-02-13 00:35:56 +13:00
Jake Barnby 17d9a72922 fix: Set MariaDB adapter for non-adapter-specific CI tests
The .env defaults were changed to mongodb, but tests that don't
explicitly set a DB adapter (general, shared mode, abuse, screenshots)
were implicitly using the default. These tests need MariaDB since
shared tables mode is not supported with MongoDB yet.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 00:34:38 +13:00
Jake Barnby 638778413d Fix workflows 2026-02-12 23:44:45 +13:00
Jake Barnby 5590f0bcd0 Merge remote-tracking branch 'origin/1.8.x' into feat-mongodb
# Conflicts:
#	.env
#	.github/workflows/tests.yml
#	app/controllers/api/projects.php
#	app/controllers/api/teams.php
#	app/init/registers.php
#	app/views/install/compose.phtml
#	composer.json
#	composer.lock
#	docker-compose.yml
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Create.php
#	src/Appwrite/Platform/Tasks/Install.php
#	src/Appwrite/Platform/Tasks/Upgrade.php
#	tests/e2e/Services/Databases/Legacy/DatabasesBase.php
#	tests/e2e/Services/Databases/TablesDB/DatabasesBase.php
2026-02-12 23:35:21 +13:00
Jake Barnby d2e77aa5cd Fix indents 2026-02-12 16:35:36 +13:00
Jake Barnby 7d5f6c9bf3 Merge remote-tracking branch 'origin/1.8.x' into feat-db-tests
# Conflicts:
#	.github/workflows/tests.yml
#	composer.lock
#	tests/e2e/Services/Projects/ProjectsConsoleClientTest.php
#	tests/e2e/Services/Teams/TeamsCustomClientTest.php
2026-02-12 12:34:42 +13:00
Chirag Aggarwal b243404a71 chore(ci): add PR comment permissions to retry jobs 2026-02-11 16:53:25 +05:30
Chirag Aggarwal dcb759e3fe chore(ci): restore retry job metadata inputs 2026-02-11 16:49:59 +05:30
Chirag Aggarwal 5371aa6820 chore(ci): add php-retry to tests workflow 2026-02-11 16:30:29 +05:30
Jake Barnby e605848541 perf: Enable --functional mode for true method-level parallelism
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 21:19:38 +13:00
ArnabChatterjee20k e3aaac7f9f Merge remote-tracking branch 'origin/1.8.x' into pg-adapter 2026-02-06 11:35:38 +05:30
Jake Barnby 24f8275f52 Revert "fix: run Databases and FunctionsSchedule tests sequentially"
This reverts commit 8dadcfeebe.
2026-02-06 04:36:55 +13:00
Jake Barnby 8dadcfeebe fix: run Databases and FunctionsSchedule tests sequentially
Parallel test execution with paratest overwhelms the single databases
worker when many tests create attributes simultaneously. Run these
specific services sequentially with PHPUnit to ensure the worker
can keep up with attribute processing jobs.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 04:15:56 +13:00
Jake Barnby 4631a2a75f Revert test changes (back to original state)
The --functional flag cannot be used because tests rely on static
properties to share state between test methods (e.g., $databaseId
set in testCreateDatabase is used by testCreateTable). With --functional,
each test method runs in a separate process so these properties are not
initialized.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 03:42:32 +13:00
Jake Barnby 1ef96627d3 fix: scale databases worker to handle parallel test load
The root cause of flaky attribute processing tests is that a single
appwrite-worker-databases container cannot keep up with attribute
creation jobs when tests run in parallel via paratest.

This fix:
- Scales the databases worker to 4 instances during E2E service tests
- Reverts timeout increases that masked the underlying issue

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 03:04:22 +13:00
Jake Barnby e70739a3c0 Merge remote-tracking branch 'origin/1.8.x' into feat-mongodb
# Conflicts:
#	Dockerfile
#	app/controllers/api/account.php
#	app/controllers/api/avatars.php
#	app/controllers/api/console.php
#	app/controllers/api/projects.php
#	app/controllers/api/storage.php
#	app/controllers/api/teams.php
#	app/http.php
#	app/init/database/filters.php
#	app/init/registers.php
#	app/init/resources.php
#	app/views/install/compose.phtml
#	composer.json
#	composer.lock
#	docker-compose.yml
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Attributes/Integer/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Bulk/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Documents/Upsert.php
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Collections/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Columns/Integer/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Bulk/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Rows/Upsert.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Tables/Update.php
#	src/Appwrite/Platform/Modules/Databases/Http/TablesDB/Update.php
#	src/Appwrite/Platform/Modules/Functions/Http/Deployments/XList.php
#	src/Appwrite/Platform/Tasks/Install.php
#	tests/e2e/Services/Projects/ProjectsConsoleClientTest.php
2026-02-05 01:01:03 +13:00
Jake Barnby afe800197b Update .github/workflows/tests.yml 2026-01-19 23:39:53 +13:00
Jake Barnby c5c2c44755 Fix PHPUnit --exclude-group deprecation warning
PHPUnit 11+ warns when using comma-separated values with --exclude-group.
This warning causes the tests to return exit code 1 despite all tests passing.

Fix by using separate --exclude-group flags for each group.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 17:33:51 +13:00
Jake Barnby 714b8d7ea6 Migrate to PHPUnit 11 2026-01-15 16:14:53 +13:00
Jake Barnby 1a22c281f5 Parallelise 2026-01-10 21:25:06 +13:00
Jake Barnby f797ae3ac6 Remove sleeps 2026-01-10 14:53:29 +13:00
Matej Bačo a37aa2dd68 Generic abuse test group 2026-01-05 22:51:11 +01:00