Commit Graph

165 Commits

Author SHA1 Message Date
Jake Barnby 8dfc4abfe0 fix: cache DatabasesStringTypesTest setup before waiting
Same cache-before-wait pattern as DatabasesBase to prevent
cascading 409 failures when attribute polling times out.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 20:47:56 +13:00
Jake Barnby bada1a7c05 Timing updates 2026-02-24 14:00:07 +13:00
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 1740ce59c0 Merge branch '1.8.x' into feat-mongodb 2026-02-16 13:16:45 +00:00
Jake Barnby bf68bb2f71 fix: resolve MongoDB-specific E2E test failures and $sequence type bug
- Fix $sequence always cast to string (was incorrectly cast to int for numeric values) in Document.php and Row.php
- Add supportForMultipleFulltextIndexes, supportForAttributeResizing, supportForSchemas console variables for MongoDB adapter
- Fix testCreateIndexes to use getSupportForMultipleFulltextIndexes() instead of getSupportForRelationships() for fulltext index error branching
- Fix testAttributeRowWidthLimit/testColumnRowWidthLimit to skip on databases without schema support (MongoDB)
- Fix testAttributeUpdateStringResize/testColumnUpdateStringResize to skip on databases without attribute resizing support (MongoDB)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 01:43:28 +13:00
copilot-swe-agent[bot] b2f48547b9 Add encrypt parameter tests for varchar, text, mediumtext, longtext attribute and column types
Co-authored-by: abnegate <5857008+abnegate@users.noreply.github.com>
2026-02-16 09:38:25 +00:00
Jake Barnby ecf0b4a1dd fix: change $sequence to string type to support MongoDB UUID7 values
The Document and Row response models were casting $sequence to (int),
which destroyed UUID7 values on MongoDB. On MongoDB, $sequence is the
internal _id field which is a UUID7 string, not an auto-increment integer.
The (int) cast converted UUID7 values like "019c56a9-df6d-73fa-8d48-..."
to 19, making $sequence queries fail validation with 400.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 00:29:38 +13:00
Jake Barnby 7708f13ebd fix: revert database package, add debug output for $sequence query failures
- Revert utopia-php/database to 5.1.2 (the Sequence validator fix
  incorrectly assumed $sequence is always integer, but on MongoDB
  internal collections it uses UUID7)
- Revert Base.php change
- Add detailed error messages to testGetDocumentWithQueries and
  testGetRowWithQueries to capture actual $sequence values and API
  error responses for debugging
- Keep Messaging scheduledAt fix (30s initial, 15s rescheduled)
- Keep Functions auth retry improvement (10 retries with project refresh)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 00:09:31 +13:00
Jake Barnby 5cf272b21a fix: add $sequence to SELECT query in testGetDocumentWithQueries
The SELECT query didn't include $sequence, so accessing
$response['body']['$sequence'] returned null. The subsequent
Query::equal('$sequence', [null.'']) produced an empty string
which is invalid for the integer $sequence field, causing 400.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 22:02:09 +13:00
Jake Barnby b7ce686d73 Merge branch '1.8.x' into feat-mongodb 2026-02-13 07:18:26 +00:00
Jake Barnby 6f56c9c2ee fix: Gate spatial index null tests on adapter capability
PostgreSQL supports spatial indexes on nullable columns and required
spatial attributes on existing data, unlike MariaDB. Expose
supportForSpatialIndexNull console variable and condition test
assertions accordingly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 06:22:53 +13:00
Jake Barnby e3c58a8c05 fix: Correct test capability gates and GraphQL dependencies
- Change spatial test gates from getSupportForRelationships() to
  getSupportForSpatials() in both Legacy and TablesDB DatabasesBase
- Add both relationship AND spatial gates for spatial relationship tests
- Add missing @depends for float, email, and datetime attributes/columns
  in GraphQL Server tests to ensure schema is complete before document/row
  creation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 05:06:48 +13:00
Jake Barnby 74b4c44bde fix: Gate relationship test on adapter support in TablesDB
MongoDB doesn't support relationships, so testInvalidRelationshipDocumentId
returns 400 instead of 202. Skip the test when the adapter lacks support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 04:59:00 +13:00
fogelito b2aa2cc247 typo 2026-02-12 16:36:37 +02:00
fogelito 5756b58d4d $tableId 2026-02-12 15:59:34 +02:00
fogelito 2cb98a87c8 tablesdb 2026-02-12 15:58:39 +02:00
fogelito db6a3342c0 fix tests 2026-02-12 15:52:39 +02: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 d617f89642 fix: Fix parallel test failures across Databases, GraphQL, Realtime, and Account
- DatabasesBase: Wait for twoWayKey attribute on library collection in
  setupOneToManyRelationship; use server API key headers for document creation
- DatabasesStringTypesTest: Add delays between attribute creation batches to
  avoid overwhelming the database worker
- SchemaPolling: Improve waitForAllAttributes error messaging
- GraphQL UsersTest: Use fresh user in testDeleteUserSession to avoid
  session conflicts
- Realtime: Increase WebSocket timeout to 120s and index polling to 60s
- Account: Add better error reporting for phone session creation failures

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 16:08:55 +13:00
Jake Barnby 1b9d0ca1c6 fix: Fix remaining parallel-safety issues from CI iteration 2
- Fix DB relationship tests: use ID::unique() for person/library collections
- Fix DB StringTypesTest: use waitForAllAttributes instead of sleep(3)
- Fix DB permissions tests: update expected counts for parallel mode
- Fix Account OAuth tests: clean up shared mock OAuth email before use
- Fix Account phone tests: ensure phone auth enabled, unique phone numbers
- Fix Messaging: compare datetime via timestamps, accept processing state
- Fix GraphQL testGetColumn: call setupStringColumn instead of setupTable
- Fix Projects: update mock numbers error message assertion

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 14:55:41 +13:00
Jake Barnby 2da4211f69 fix: Make E2E tests parallel-safe for functional mode
- Fix missing return statement in DatabasesBase::testListDocuments
- Rewrite DatabasesStringTypesTest with project-keyed setup cache
- Use assertGreaterThanOrEqual in Functions testListDeployments
- Clean up OIDC provider after Account OAuth2 test
- Key all GraphQL static caches by project ID with unique IDs
- Replace sleep() with assertEventually in Realtime tests
- Increase Messaging scheduled message timeout to 180s
- Increase Sites deployment timeouts to 120s

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 13:25:19 +13:00
Jake Barnby 4f7337759f Expose row bytes used/bytes free on table/collection 2026-02-05 22:53:04 +13:00
Jake Barnby 6850d7ae9e fix: add sleep for async attribute deletion verification
Attribute deletion is asynchronous - add sleep to wait for deletion
to complete before verifying the attribute no longer exists.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 02:01:01 +13:00
Jake Barnby 45a3793cc0 fix: correct expected default values and attribute name in tests
- Update expected default values to match the actual defaults (update
  tests are skipped, so original defaults apply)
- Fix varchar_max -> varchar_min (varchar_max was never created)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 01:48:36 +13:00
Jake Barnby 0aff01793b fix: remove @depends annotations from DatabasesStringTypesTest
Replace @depends annotations with static property assertions to fix
compatibility issues with PHPUnit 12 and paratest parallel execution.

Tests now use self::$databaseId and self::$collectionId/self::$tableId
directly instead of passing data between dependent tests.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 01:18:16 +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 d4694ff8af Merge remote-tracking branch 'origin/1.8.x' into feat-db-tests
# Conflicts:
#	composer.json
#	composer.lock
#	tests/e2e/Services/Databases/TablesDB/DatabasesBase.php
#	tests/e2e/Services/Projects/ProjectsConsoleClientTest.php
#	tests/e2e/Services/Realtime/RealtimeCustomClientTest.php
2026-02-04 19:49:09 +13:00
Jake Barnby 413a91bd0a Lint 2026-02-03 22:33:51 +13:00
Jake Barnby 23c3496a63 Add missing model map 2026-02-03 22:30:02 +13:00
Jake Barnby c9aac86a6b Merge remote-tracking branch 'origin/1.8.x' into feat-string-types
# Conflicts:
#	composer.lock
2026-01-30 02:07:33 +13:00
premtsd-code 71670f8169 Merge branch '1.8.x' into fix-10612-validate-relationship-document-id 2026-01-28 11:17:50 +00:00
Prem Palanisamy 7f3ea98924 refactor: use array_is_list() and assertEventually helper 2026-01-27 13:00:29 +00:00
Prem Palanisamy 63e6a51af1 test: add assertion for relationship column polling 2026-01-26 15:45:42 +00:00
Prem Palanisamy 1ee2539ce0 fix: generate unique ID before validation per coderabbit suggestion 2026-01-26 15:45:42 +00:00
Prem Palanisamy aed9816d1e fix: validate relationship document ID 2026-01-26 13:48:32 +00:00
Jake Barnby 046a7cd90e test: skip update tests pending utopia-php/database fix
The updateAttribute method in utopia-php/database does not yet support
VARCHAR, TEXT, MEDIUMTEXT, and LONGTEXT types. These tests are skipped
until the upstream library adds support for updating these attribute types.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 06:15:21 +13:00
Jake Barnby c42fbc49f5 fix: remove max-size varchar test that exceeds row width limit
The test tried to create multiple VARCHAR attributes in the same
collection, including a 16381-character varchar. The cumulative
row width exceeded MariaDB's 65535 byte row limit, causing the
test to fail with a 400 error.

Calculation: 1067 (base) + 1021 (255*4+1) + 401 (100*4+1) + 201
(50*4+1) + 20 (array) + 65526 (16381*4+2) = 68236 bytes > 65535

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 04:25:06 +13:00
Jake Barnby 60a0b663b9 Add tests 2026-01-23 01:51:52 +13:00
Jake Barnby 2cfb5ecfd9 Reapply "Merge pull request #11130 from appwrite/feat-auth-instance"
This reverts commit 38687bc24e.
2026-01-15 04:08:00 +13:00
Jake Barnby 38687bc24e Revert "Merge pull request #11130 from appwrite/feat-auth-instance"
This reverts commit c12cad80bb, reversing
changes made to 2a17429226.

# Conflicts:
#	composer.lock
2026-01-15 03:48:42 +13:00
Jake Barnby 5c915ef92f Reapply "Merge pull request #11099 from appwrite/feat-auth-instance"
This reverts commit 321fc8ee70.
2026-01-14 19:07:49 +13:00
Jake Barnby 321fc8ee70 Revert "Merge pull request #11099 from appwrite/feat-auth-instance"
This reverts commit a4734a5de7, reversing
changes made to 15922fb88c.

# Conflicts:
#	composer.lock
2026-01-14 02:37:17 +13:00
Jake Barnby 9498a8ba5d Consolidate, remove depends, add fixtures 2026-01-10 03:21:31 +13:00
Jake Barnby 7573ee75a2 Use authorization instance 2026-01-07 20:04:28 +13:00
Darshan 16f9c35850 update: tests. 2026-01-04 12:09:11 +05:30
Jake Barnby dc85d44647 Revert "Refactor auth single instance" 2025-12-20 02:54:50 +13:00
Jake Barnby 13f4aa9a80 Merge remote-tracking branch 'origin/1.8.x' into refactor-auth-single-instance
# Conflicts:
#	app/controllers/api/account.php
#	app/controllers/api/vcs.php
#	app/controllers/general.php
#	app/controllers/shared/api.php
#	app/init/resources.php
#	composer.lock
#	src/Appwrite/Platform/Modules/Console/Http/Resources/Get.php
#	src/Appwrite/Platform/Modules/Databases/Http/Databases/Transactions/Update.php
#	src/Appwrite/Platform/Modules/Functions/Http/Executions/Create.php
#	src/Appwrite/Platform/Workers/Migrations.php
2025-12-18 18:17:41 +13:00
ArnabChatterjee20k 70395cfacc added tableid and collectionid in increment and decrement 2025-12-13 23:43:51 +05:30
Darshan ef5f0ed6b4 update: to use placeholders. 2025-12-11 15:26:45 +05:30
Jake Barnby c5dadc787d Block operator tests 2025-12-11 00:23:46 +13:00