Commit Graph

5607 Commits

Author SHA1 Message Date
Matej Bačo d8954f424c Fix specs tests 2026-03-09 15:09:57 +01:00
Matej Bačo 58e5e69fec Vuln fixes 2026-03-09 13:01:00 +01:00
Matej Bačo 895ec7fd20 security fix 2026-03-09 12:56:51 +01:00
Matej Bačo d3442d86c1 Rework time travel to CLI task 2026-03-09 12:54:12 +01:00
Matej Bačo c20dfc7063 PR simplification 2026-03-09 11:51:32 +01:00
Matej Bačo 591cc70e76 Merge branch '1.8.x' into revert-11447-revert-10862-feat-1.8.x-new-schema 2026-03-09 11:42:09 +01:00
loks0n b6793dc0b5 Fix remaining blocked account test assertions
Update testBlockedAccount and testSelfBlockedAccount to expect 403
instead of 401 for blocked user responses. These were missed in the
previous test assertion update.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-06 17:43:36 +00:00
loks0n a2ad25a00a Update test assertions for blocked user status code
Change expected status code from 401 to 403 for USER_BLOCKED errors
to match the semantic change in error codes.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-06 17:30:51 +00:00
Chirag Aggarwal f2826189c6 fix: remove asserting z does not exist in truncated logs 2026-03-06 18:24:04 +05:30
Jake Barnby 91edf82060 fix: database index length assertion and email race in password recovery
- Remove specific index length number from testPatchAttribute assertion
  since the value differs between shared/non-shared table modes (767 vs
  768) and the console API returns the console project's value, not the
  user project's
- Use getLastEmailByAddress in testPasswordRecoveryUrlParams to avoid
  retrieving emails from parallel test classes sharing the same maildev

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 03:41:35 +13:00
Jake Barnby 65780d75f9 fix: test flakes — correct index length fallback, add retries
- Fix getMaxIndexLength() fallback from 768 to 767 to match MariaDB's
  actual InnoDB index key limit
- Add retry logic to getConsoleVariables() to handle intermittent 401s
- Add retry logic to API key creation in ProjectCustom to prevent
  cascading 401 failures in test methods

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 03:01:23 +13:00
Jake Barnby ee107d30b3 fix: make Projects tests parallel-safe
- Use getLastEmailByAddress for SMTP tests instead of getLastEmail(2) to
  avoid shared mail server state issues under parallel execution
- Add retry logic to setupProject, setupProjectData, and
  setupScheduleProjectData for intermittent 401 errors

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 01:20:09 +13:00
Jake Barnby ab85942276 fix: add retry and session verification to getRoot() for parallel tests
getRoot() now retries up to 5 times with session verification to handle
race conditions when multiple paratest workers initialize simultaneously.
Previously, if account creation or session creation failed under load,
all subsequent test requests would fail with 401.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 23:19:54 +13:00
Matej Bačo 248b3c8b32 Revert "Revert "Features with schema changes"" 2026-03-04 14:31:27 +01:00
Matej Bačo f8b31e7db7 Revert "Features with schema changes" 2026-03-04 14:31:05 +01:00
Matej Bačo 1f5fd919c9 Merge branch '1.8.x' into feat-1.8.x-new-schema 2026-03-04 14:13:01 +01:00
loks0n cf7710b580 perf: reduce WebSocket timeout in realtime tests from 45s to 2s
Realtime E2E tests were taking 24+ minutes due to intentional timeout waits. Many tests verify event filtering by expecting a TimeoutException, and each was waiting 45 seconds.

Changes:
- Reduce default WebSocket timeout from 45s to 2s in RealtimeBase
- Add optional timeout parameter to getWebsocket() methods
- Use longer timeouts (5-10s) for tests that legitimately wait for slow operations (function executions, test channel events)
- Use named parameters for improved readability

Performance impact:
- Before: 24:07 minutes (1,447 seconds)
- After: 1:09 minutes (69 seconds)
- Speedup: ~21x faster

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-03-03 22:47:28 +00:00
ArnabChatterjee20k 05a2f56945 updated tests 2026-03-02 14:27:54 +05:30
ArnabChatterjee20k 3d4f37c482 refactor: improve channel handling for Realtime events and update tests for TablesDB compatibility 2026-03-02 14:12:13 +05:30
Prem Palanisamy b3b2fe3ba2 Merge remote-tracking branch 'origin/1.8.x' into migration-resource-enum-fix 2026-02-27 09:01:31 +00:00
Jake Barnby 3c4c78d086 Merge branch '1.8.x' into fix-realtime-regions 2026-02-27 06:07:06 +00:00
copilot-swe-agent[bot] 339ecc418d test: remove testConnectionFailureRegionMismatch and mock PATCH route
Co-authored-by: abnegate <5857008+abnegate@users.noreply.github.com>
2026-02-26 12:46:47 +00:00
copilot-swe-agent[bot] 5ff7e2af24 fix: revert regions.php, add mock PATCH route for project region in tests
Co-authored-by: abnegate <5857008+abnegate@users.noreply.github.com>
2026-02-26 12:31:05 +00:00
copilot-swe-agent[bot] 9aa47c267d test: add region mismatch failure test and fra region to config
Co-authored-by: abnegate <5857008+abnegate@users.noreply.github.com>
2026-02-26 12:14:23 +00:00
Prem Palanisamy 12dca64b60 Merge remote-tracking branch 'origin/1.8.x' into migration-resource-enum-fix 2026-02-26 12:04:16 +00:00
copilot-swe-agent[bot] 952f48c72a fix: use AppwriteException, fix console region, add region check test
Co-authored-by: abnegate <5857008+abnegate@users.noreply.github.com>
2026-02-26 11:55:15 +00:00
Jake Barnby 1c85789a6e fix: scope cache tests to setup document IDs to avoid count mismatch
The testListDocumentsWithCache and testListDocumentsCacheBustedByAttributeChange
tests were failing because testCreateDocument (which runs earlier) adds 3 more
documents to the same movies collection, resulting in 6 docs instead of expected 3.
Additionally, the cache bust test was getting a cache 'hit' instead of 'miss' on
its first request due to sharing the same cache key as the previous test.

Fix by filtering all cache test queries to the 3 known setup document IDs, and
using distinct select/order queries in each test to avoid cache key collisions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 20:34:46 +13:00
Jake Barnby b174a50b2a fix: address coderabbit review comments
- Fix indentation alignment in cache hit detection condition
- Add total count assertions for cached and non-cached responses in test

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 19:00:25 +13:00
Jake Barnby 3e0ee30428 Add tests for collection bust 2026-02-26 18:31:52 +13:00
Jake Barnby d49dea9790 Merge remote-tracking branch 'origin/1.8.x' into cached-documents-list
# Conflicts:
#	composer.lock
#	tests/e2e/Services/Databases/DatabasesBase.php
2026-02-26 17:02:33 +13:00
Jake Barnby 0272a7f337 Merge pull request #11404 from appwrite/realtime-channels-tablesdb-fix 2026-02-26 03:43:50 +00:00
ArnabChatterjee20k ca8d613614 updated test 2026-02-25 19:46:09 +05:30
ArnabChatterjee20k 8c579cf88d updated string filtering in the filters 2026-02-25 19:29:03 +05:30
ArnabChatterjee20k a57d970840 Add support for tablesdb in event generation and realtime channels 2026-02-25 18:58:33 +05:30
premtsd-code de21cab22a Merge branch '1.8.x' into migration-resource-enum-fix 2026-02-25 10:28:28 +00:00
Jake Barnby a43e94990b Lint 2026-02-25 21:49:31 +13:00
Jake Barnby c91252d94c Switch types 2026-02-25 21:42:28 +13:00
Prem Palanisamy d58873ef14 added site migration E2E test 2026-02-24 15:54:42 +00:00
Jake Barnby 9dd707cd1b Merge branch '1.8.x' into cached-documents-list 2026-02-24 09:04:32 +00:00
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 3b3177722b fix: cache setup data before waiting to prevent 409 on retry
When setupAttributes() or setupIndexes() timed out during
waitForAllAttributes/waitForAllIndexes, the cache was never populated.
Subsequent test methods calling setup again would find empty cache,
reuse the same collection IDs (from collection cache), and attempt to
re-create existing attributes/indexes, resulting in 409 Conflict errors.

Fix: populate the static cache immediately after successful creation
(202 assertions), before the wait calls. This ensures retries skip
creation and go straight to waiting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 20:06:20 +13:00
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 07dc088e4e fix: improve E2E test probes and enable function webhook events
- Fix testPasswordRecoveryUrlParams: use URL-based probes instead of
  userId-based probes to distinguish between test cases that share the
  same user
- Enable functions.* webhook events in ProjectCustom for function
  webhook tests that were silently passing by matching stale events
- Fix setupTeamMembership: add email address probe to getLastEmail to
  prevent picking up wrong invitation email
- Fix getLastEmail multi-email race: assert count inside assertEventually
  when requesting multiple emails

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 15:15:59 +13:00
Jake Barnby 5cb36a0a3a fix: resolve E2E test race conditions in parallel execution
- Add probe callback support to getLastEmail(), getLastEmailByAddress(),
  and getLastRequest() to filter results by content before accepting
- Fix variable name typo in TeamsCustomClientTest ($email vs $lastEmail)
- Add event probes to all 56 webhook test getLastRequest() calls to
  filter by specific event pattern (resource ID + action)
- Add email probes to Account OTP/recovery/magic-url tests to wait for
  the correct email (security phrase, Password Reset subject, etc.)
- Add email probes to Projects tests for recovery email URL matching
- Increase FunctionsSchedule future time from 1min to 2min to avoid
  timing issues when seconds are zeroed

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 14:43:15 +13:00
Jake Barnby 1cb7c4b3f6 Merge remote-tracking branch 'origin/1.8.x' into feat-mongodb
# Conflicts:
#	.gitignore
#	composer.lock
#	tests/e2e/Services/Teams/TeamsCustomClientTest.php
2026-02-24 14:06:57 +13:00
Jake Barnby bada1a7c05 Timing updates 2026-02-24 14:00:07 +13:00
Matej Bačo f0c8f7e00e Update tests/e2e/Services/Projects/ProjectsConsoleClientTest.php
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-23 16:49:17 +01:00
Matej Bačo f4ee6488ac Add tests for custom url schema in redirects 2026-02-23 13:09:26 +01:00