Commit Graph

17 Commits

Author SHA1 Message Date
Jake Barnby e1791e17c3 fix: increase attribute/index polling timeouts to 240s for shared mode CI
Shared tables mode experiences significant worker queue contention during
parallel test execution. 120s was insufficient for attribute processing
in Shared V1 mode and occasionally for PostgreSQL under load.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 17:50:46 +13:00
Jake Barnby 9a97694a19 fix: resolve flaky E2E tests for realtime, avatars, migrations, and GraphQL
- Realtime: Use getLastEmailByAddress with userId probe instead of getLastEmail
  to prevent email race conditions in parallel execution; add status assertions
  on verification/recovery PUT responses for clearer failure diagnostics
- Avatars: Wrap external URL image fetches in assertEventually to retry
  transient network failures from appwrite.io
- Migrations: Increase performMigrationSync timeout from 10s to 60s
- GraphQL: Increase attribute polling timeouts from 60s to 120s with 500ms
  intervals to accommodate PostgreSQL under CI load

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 16:51:22 +13:00
Jake Barnby 7df86a3838 fix: cast attribute defaults after queue deserialization and improve test robustness
- Fix float/int/bool attribute creation failures caused by type loss
  during queue serialization in the Databases worker
- Rework session limit test to retry session creation for cache
  propagation in shared mode
- Increase GraphQL attribute polling timeouts from 30s to 60s
- Increase SchemaPolling waitForAllAttributes timeout to 180s
- Increase Realtime WebSocket client timeout from 30s to 45s

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 16:02:23 +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 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 161e4e53d4 fix: Address remaining parallel-safety failures across all test suites
- Fix Legacy DatabasesStringTypesTest with project-keyed setup cache
- Fix Account OTP test with unique email, phone session re-login
- Fix GraphQL setup methods with sleep, 409 handling, missing columns
- Fix Databases list/pagination tests with document ID filtering
- Fix Permissions tests with assertGreaterThanOrEqual for counts
- Fix Messaging scheduled tests to not depend on scheduler timing
- Increase Realtime WebSocket timeout to 60s and assertEventually to 30s

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 14:20:42 +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 0e828f3fcc fix: Handle 409 conflicts in GraphQL Legacy tests
- setupDatabase() now fetches existing database on conflict
- setupCollections() now fetches existing collections on conflict
- Enables parallel test execution with fixed resource IDs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 20:55:59 +13:00
Jake Barnby 2a3e2d8be5 perf: Remove @depends from all GraphQL tests
Added helper methods with static caching for:
- Legacy/DatabaseClientTest.php
- Legacy/DatabaseServerTest.php
- TablesDB/DatabaseClientTest.php
- TablesDB/DatabaseServerTest.php

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 12:01:31 +13:00
Jake Barnby 4adc4f65ad Add missing PHPUnit #[Depends] to GraphQL Functions tests
Fixed missing #[Depends] attributes:
- FunctionsClientTest: 4 methods (testCreateDeployment, testCreateExecution,
  testGetExecutions, testGetExecution)
- FunctionsServerTest: 11 methods (all test methods with parameters)
- Legacy/DatabaseServerTest: Fixed testCreateIndex dependency
  (was depending on void-returning testUpdateURLAttribute)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 18:28:38 +13:00
Jake Barnby 7d6ac8f7a2 Add missing PHPUnit #[Depends] attributes
PHPUnit 11 requires explicit #[Depends] attributes instead of the old
@depends annotations. Several test methods were missing these attributes,
causing "Too few arguments" errors when PHPUnit tried to run the tests.

Fixed in:
- AccountCustomClientTest: testUpdateAccountPassword, testUpdateAccountRecovery, testCreateSession
- GraphQL/Legacy/DatabaseServerTest: Added 36 missing #[Depends] attributes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 17:51:31 +13:00
Jake Barnby 714b8d7ea6 Migrate to PHPUnit 11 2026-01-15 16:14:53 +13:00
Jake Barnby 2776925540 Tests via console features 2025-11-25 21:11:01 +13:00
Jake Barnby bae759957c Fix graphql test 2025-10-23 23:57:11 +13:00
Jake Barnby 6d2832831c Remove weird static/const mix 2025-08-19 23:03:18 +12:00
Darshan 7ebe8f6c9e revert: legacy tests namespacing to old. 2025-06-19 17:34:16 +05:30