-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Added tests for the sequence filter #10159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 1.8.x
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughA new PHPUnit test class named Possibly related PRs
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Security Scan Results for PRDocker Image Scan Results
Source Code Scan Results🎉 No vulnerabilities found! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
tests/unit/Utopia/Response/Filters/V20Test.php (1)
23-126
: Consider adding edge case tests for comprehensive coverage.The current tests effectively cover the main functionality. Consider adding these optional test cases:
- Documents without a
$sequence
field (to ensure no errors occur)- Empty document lists
- Documents with nested structures that might contain
$sequence
fieldsExample additional test cases:
public function edgeCasesProvider(): array { return [ 'document without sequence field' => [ [ 'name' => 'John Doe', '$id' => 'doc1', ], [ 'name' => 'John Doe', '$id' => 'doc1', ] ], 'empty document list' => [ ['documents' => []], ['documents' => []] ] ]; }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
tests/unit/Utopia/Response/Filters/V20Test.php
(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: ItzNotABug
PR: appwrite/appwrite#9669
File: src/Appwrite/Utopia/Request/Filters/V19.php:56-71
Timestamp: 2025-05-03T05:58:34.294Z
Learning: According to the developer, wildcard select handling in V19 request filter is only needed for `listDocuments` operations, not for `getDocument` operations, despite the doc-block mentioning both.
tests/unit/Utopia/Response/Filters/V20Test.php (1)
Learnt from: ItzNotABug
PR: appwrite/appwrite#9669
File: src/Appwrite/Utopia/Request/Filters/V19.php:56-71
Timestamp: 2025-05-03T05:58:34.294Z
Learning: According to the developer, wildcard select handling in V19 request filter is only needed for `listDocuments` operations, not for `getDocument` operations, despite the doc-block mentioning both.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
- GitHub Check: E2E Service Test (Projects)
- GitHub Check: E2E Service Test (Webhooks)
- GitHub Check: E2E Service Test (Realtime)
- GitHub Check: E2E Service Test (Messaging)
- GitHub Check: E2E Service Test (Storage)
- GitHub Check: E2E Service Test (VCS)
- GitHub Check: E2E Service Test (Users)
- GitHub Check: E2E Service Test (Sites)
- GitHub Check: E2E Service Test (Tokens)
- GitHub Check: E2E Service Test (Proxy)
- GitHub Check: E2E Service Test (Teams)
- GitHub Check: E2E Service Test (FunctionsSchedule)
- GitHub Check: E2E Service Test (Functions)
- GitHub Check: E2E Service Test (Databases/Legacy)
- GitHub Check: E2E Service Test (Avatars)
- GitHub Check: E2E Service Test (Console)
- GitHub Check: E2E Service Test (Site Screenshots)
- GitHub Check: E2E Service Test (Dev Keys)
- GitHub Check: E2E General Test
- GitHub Check: Unit Test
🔇 Additional comments (6)
tests/unit/Utopia/Response/Filters/V20Test.php (6)
1-11
: LGTM! Clean class structure and imports.The class follows PHPUnit conventions with proper namespace, imports, and nullable type hint for the filter property.
13-21
: LGTM! Proper test setup and cleanup.The setUp and tearDown methods correctly initialize and clean up the filter instance following PHPUnit best practices.
23-50
: LGTM! Comprehensive document data provider.The data provider includes realistic document fields and properly tests the removal of the
$sequence
field while preserving all other fields.
52-59
: LGTM! Correct single document test implementation.The test method properly uses the data provider and verifies that the V20 filter removes the
$sequence
field from single documents.
61-117
: LGTM! Comprehensive document list data provider.The data provider correctly tests the filter's behavior on document lists, ensuring the
$sequence
field is removed from all documents while preserving other fields.
119-126
: LGTM! Correct document list test implementation.The test method properly uses the data provider and verifies that the V20 filter removes the
$sequence
field from document lists.
✨ Benchmark results
⚡ Benchmark Comparison
|
3e2a61f
to
ede1c3d
Compare
What does this PR do?
(Provide a description of what this PR does and why it's needed.)
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Screenshots may also be helpful.)
Related PRs and Issues
Checklist