Match chat test parity codegen#219
Match chat test parity codegen#219daksh-r wants to merge 15 commits intocha-1578_openapi-refactor-codegenfrom
Conversation
📝 WalkthroughWalkthroughLarge v2→v3 migration: request/response payloads standardized to generated Request/.to_dict() and Response types; many new endpoints and optional parameters across Chat, Common, Feeds, Moderation, Video; new webhook module; expanded tests and CI/release workflow tweaks. Several method signatures extended or added. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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. Comment |
Add comprehensive test coverage for chat functionality matching the old stream-chat-python SDK. Includes tests for channels, messages, moderation, users, misc operations, reminders/locations, and team usage stats. Also updates codegen for team usage stats endpoint and undelete message fix. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
f0d2920 to
d635d5a
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- test_add_moderators: check is_moderator is not True (API returns None, not False) - test_mute_user/test_mute_with_timeout: use mutes[0] not mute (MuteResponse has mutes list) - test_create_reminder: response is ReminderResponseData directly, not wrapped - test_update_reminder: use response.data.reminder (UpdateReminderResponse wraps it) - skip test_delete_message_for_me: delete_for_me needs body param not query param - skip test_query_message_flags: V2 moderation.flag() doesn't populate chat-level flags Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
GetChannelTypeResponse.commands returns List[Command] objects, but update_channel_type expects List[str]. Extract .name from each command. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add draft tests (create/get/delete/thread/query), enhance channel tests (members $in query, filter tags, hide/show hidden filter, invite error handling), enhance message tests (replies pagination, reactions offset), and add user custom field filter+sort test. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Free Tier Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| while True: | ||
| response = client.get_task(id=task_id) | ||
| if response.data.status == "completed": | ||
| if response.data.status in ("completed", "failed"): |
There was a problem hiding this comment.
wait_for_task silently returns on task failure
Low Severity
wait_for_task now returns successfully when status is "failed", treating it the same as "completed". While current callers happen to assert status == "completed" afterward, any future caller that simply uses the return value without checking the status will silently accept a failed task. The function name and docstring imply it waits for successful completion, creating a subtle contract mismatch.


Note
Medium Risk
Medium risk due to CI workflow changes (new chat env vars, test suite split) and a small Feeds API surface change (
query_commentsaddsid_around). Main risk is increased CI runtime/flakiness from extensive new end-to-end chat tests and reliance on separate credentials.Overview
Adds a large end-to-end Chat test suite (channels, members, messages, drafts, moderation, polls, reminders/live locations, usage stats, users) plus new pytest fixtures for creating/cleaning up temporary users and channels.
Updates CI to inject separate
STREAM_CHAT_*credentials and split pytest into non-video (run with chat creds and ignoring video paths) vs video tests.Extends Feeds
query_commentsto support theid_aroundrequest field, updates the generatedQueryCommentsRequestmodel accordingly, and tweaks an async export error event default type constant.Written by Cursor Bugbot for commit ead8884. This will update automatically on new commits. Configure here.
Summary by CodeRabbit
Breaking Changes
New Features
Documentation
Tests