Commit Graph

241 Commits

Author SHA1 Message Date
Matej Bačo db406b0a27 Fix tests 2026-04-13 15:08:20 +02:00
Matej Bačo 28d285d5c5 Improved tests for webhook edge cases 2026-04-13 14:53:06 +02:00
Matej Bačo a1267b1bff Backwards compatibiltiy tests 2026-04-11 11:16:43 +02:00
Matej Bačo bf375d1d40 Fix bugs 2026-03-17 13:52:50 +01:00
Matej Bačo fd05827089 Implement tests 2026-03-17 13:27:53 +01:00
Matej Bačo ac2b35004d Add more public webhook endpoints 2026-03-17 13:03:26 +01:00
Matej Bačo 677bb048cc Introduce new webhooks API 2026-03-17 11:03:18 +01: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 bada1a7c05 Timing updates 2026-02-24 14:00:07 +13:00
Jake Barnby acad17f3b8 fix: resolve test failures and reduce excessive timeouts
- DatabasesBase: fix 5 merge corruption issues (missing integers2 attr,
  undefined vars, wrong assertion, wrong setup method)
- WebhooksBase: increase deployment build timeout from 10s to 120s
- RealtimeBase: reduce WebSocket timeout 120s→30s, fix deprecated nullable
- RealtimeConsoleClientTest: reduce assertEventually 120s→30s
- SchemaPolling: reduce all default timeouts 600s→60s
- SitesBase: reduce build timeout 300s→120s, activation 200s→60s

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 14:23:42 +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 2d05d608f4 Upgrade utopia-php dependencies and fix namespace changes
- Upgrade utopia-php/cli from 0.15 to 0.22
- Upgrade utopia-php/analytics from 0.10 to 0.15
- Upgrade utopia-php/orchestration from 0.9 to 0.19
- Use dev branches for utopia-php/framework and utopia-php/platform
- Remove utopia-php/swoole dependency (merged into framework)
- Migrate Utopia\CLI\Console to Utopia\Console across all files
- Migrate Utopia\Http to Utopia\Http\Http namespace
- Migrate Utopia\Swoole\Files to Utopia\Http\Files (now instance-based)
- Convert static CLI::setResource() calls to instance-based Dependency API
- Fix StatsResources task named parameter mismatch
2026-02-10 10:34:24 +05:30
Jake Barnby 870ccc9a1b fix: Fix webhook tests for parallel mode
- testDeleteUser: User is created with status=true, so assert that
- testUpdateUserStatus: Use probe to find correct webhook event

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 21:58:53 +13:00
Jake Barnby 0737ba1329 fix: Make more tests parallel-safe for functional mode
- Account: Use unique emails/phone numbers to avoid collisions
- Functions: Use flexible assertions for counts and search results
- GraphQL: Add better error handling and use unique IDs
- Projects: Use assertGreaterThanOrEqual for list counts
- Webhooks: Use probe to find specific delete webhook event

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 21:48:55 +13:00
Jake Barnby 6e103393b8 fix: Fix undefined $data variables in Webhooks tests
- testCreateAttributes: Use $actorsId instead of undefined $data['actorsId']
- testCreateColumns: Use $actorsId instead of undefined $data['actorsId']
- testCreateAccountSession: Add assertion for account creation success

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 21:23:44 +13:00
Jake Barnby ce200d20d4 fix: Make webhook account tests self-sufficient
Update account name before testing to ensure webhook data has
expected 'New Name' value, regardless of test execution order.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 20:59:58 +13:00
Jake Barnby 8627251ae4 fix: Make testDeleteStorageBucket self-sufficient
Update bucket name before deleting to ensure webhook data has
expected name, regardless of whether testUpdateStorageBucket ran.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 20:59:16 +13:00
Jake Barnby b1257cc40a perf: Remove @depends from Webhooks and Teams tests
Enables --functional mode for parallel test execution by:
- Adding helper methods for independent test setup
- Removing all #[Depends] annotations
- Using static caching for shared resources

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 04:47:12 +13:00
Jake Barnby 7498c330eb Add missing PHPUnit #[Depends] to Functions, Messaging, Webhooks tests
Fixed missing #[Depends] attributes:
- FunctionsCustomServerTest: testCancelDeploymentBuild → testCreateDeployment
- MessagingBase: testDeleteMessage → testSendEmail
- WebhooksBase: testDeleteDocument → testUpdateDocument, testDeleteRow → testUpdateRow
- WebhooksCustomClientTest: testUpdateAccountName → testDeleteAccountSessions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 18:18:55 +13:00
Jake Barnby 714b8d7ea6 Migrate to PHPUnit 11 2026-01-15 16:14:53 +13:00
loks0n f765eb92e7 feat: cors service 2025-12-11 09:01:31 +00:00
Khushboo Verma be983eb68a Remove race condition 2025-10-16 14:40:47 +05:30
Khushboo Verma f0660f3fda Replace sleep in webhook tests with assertEventually 2025-10-16 14:23:35 +05:30
Jake Barnby ca03be5e41 Test fixes 2025-08-18 21:16:01 +12:00
Darshan 7a5a3706b6 fix: tests. 2025-07-27 18:13:30 +05:30
Jake Barnby 9ceeb76ad0 Merge branch '1.7.x' into 1.8.x
# Conflicts:
#	app/controllers/api/databases.php
#	composer.lock
#	src/Appwrite/GraphQL/Types/Mapper.php
2025-07-18 17:24:12 +12:00
Matej Bačo 581235f972 Fix more tests 2025-07-10 14:43:56 +02:00
Jake Barnby b2fa28754d Merge remote-tracking branch 'origin/1.7.x' into 1.8.x
# Conflicts:
#	.github/workflows/benchmark.yml
#	composer.lock
#	src/Appwrite/Event/Database.php
2025-07-04 10:00:45 -04:00
Darshan afa8341f95 add: table apis to webhook custom server tests. 2025-05-10 11:01:36 +05:30
Darshan 45370f91c3 add: table apis to webhook tests. 2025-05-10 10:52:43 +05:30
Darshan d3f1c4f852 revert: tests to collections API. 2025-05-09 15:10:44 +05:30
Darshan 9e1105b61f update: tests. 2025-05-06 11:29:56 +05:30
Darshan f94ecc885a fix: tests as per new events system. 2025-04-27 10:36:21 +05:30
Darshan f56fcc6d90 fix: remaining tests! pheww! 2025-03-29 19:56:13 +05:30
Darshan 736078203a update: change method name. 2025-03-29 18:22:59 +05:30
Darshan b1c67e6f74 fix: other remaining tests. 2025-03-29 18:21:25 +05:30
Chirag Aggarwal fe7aeefabf chore: remove redundant param 2025-03-03 16:20:32 +00:00
Chirag Aggarwal fc05a4f1e3 chore: updated to use assertEventually 2025-03-03 16:07:33 +00:00
Chirag Aggarwal e865ca74d7 chore: added timeout to webhooks base test 2025-03-03 14:41:11 +00:00
loks0n 9d4fd41701 fix: webhook test 2024-10-29 11:56:41 +00:00
Jake Barnby c58fa78962 Remove tenant in filter 2024-09-05 14:25:11 +12:00
Matej Bačo f98184405b Upgrade OPR versions 2024-08-22 12:15:38 +00:00
Jake Barnby 93f50e1e0e Lint 2024-05-22 12:51:27 +12:00
Torsten Dittmann 0a1d572c72 chore: run formatter 2024-03-06 18:34:21 +01:00
Khushboo Verma 7efdc7556d Fix formatting and remove flaky test 2024-01-18 18:12:58 +05:30
Khushboo Verma e3f83b1335 Assert that webhook is disabled 2024-01-18 17:58:18 +05:30
Khushboo Verma 3a1fe3b2a7 Add webhook tests 2024-01-18 15:19:57 +05:30
Matej Bačo e9de0332cc Remove passwordAgain (#7441) 2024-01-12 14:33:10 +01:00
Christy Jacob c21a063642 fix: failing tests 2023-12-09 01:02:13 +01:00