-
Notifications
You must be signed in to change notification settings - Fork 25
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
Fix some test failures that result from Realtime error changes #2006
Conversation
Started failing recently, presumably as a result of some Realtime change.
Started failing recently, presumably as a result of some Realtime change. Have switched them to use the code that’s now being returned. Not sure of the difference between these two codes; have asked in [1]. [1] https://ably-real-time.slack.com/archives/CURL4U2FP/p1736356509105489
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 SwiftLint (0.57.0)Test/Tests/AuthTests.swift[ Test/Tests/RealtimeClientConnectionTests.swift[ Test/Tests/RestClientTests.swift[ WalkthroughThe pull request focuses on updating error code references in test files related to authentication and connection failures. The changes primarily involve replacing Changes
Assessment against linked issues
Possibly related PRs
Poem
Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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
CodeRabbit Configuration File (
|
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 (2)
Test/Tests/RealtimeClientConnectionTests.swift (1)
4135-4136
: LGTM! The comment explains the dual error code handling well.The comment provides valuable context about why both
invalidCredential
andinvalidCredentials
error codes need to be handled due to the production environment using both frontend and frontdoor systems.Consider adding a period at the end of the comment for consistency:
- // This is because, at time of writing, the production environment is handling connections using both frontend (which returns invalidCredential) and frontdoor (which returns invalidCredentials). So we need to handle both cases at least for now (unlike other tests, which use sandbox which is 100% using frontdoor) + // This is because, at time of writing, the production environment is handling connections using both frontend (which returns invalidCredential) and frontdoor (which returns invalidCredentials). So we need to handle both cases at least for now (unlike other tests, which use sandbox which is 100% using frontdoor).Test/Tests/RestClientTests.swift (1)
196-196
: Standardize error code validation for authentication failuresThe changes update the error code validation to use
ARTErrorCode.invalidCredentials
consistently across authentication failure test cases.Consider adding a test helper function to encapsulate common error code validation logic, as this pattern appears in multiple test cases.
Also applies to: 237-237
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
Test/Tests/AuthTests.swift
(1 hunks)Test/Tests/RealtimeClientConnectionTests.swift
(1 hunks)Test/Tests/RestClientTests.swift
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: check (tvOS, test_tvOS17_2)
🔇 Additional comments (1)
Test/Tests/AuthTests.swift (1)
415-415
: LGTM! Good improvement to error validation.Switching from error message string validation to error code validation makes the test more robust and reliable, as error messages can change but error codes are more stable.
See commit messages for more details. Resolves #2008.
Summary by CodeRabbit
ARTErrorCode.invalidCredentials
instead ofARTErrorCode.invalidCredential