Add UTS realtime unit and integration test specs#460
Open
paddybyers wants to merge 32 commits intouts-restfrom
Open
Add UTS realtime unit and integration test specs#460paddybyers wants to merge 32 commits intouts-restfrom
paddybyers wants to merge 32 commits intouts-restfrom
Conversation
Add test specs covering connection failures (RTN14/RTN15), open failures, error reason handling, fallback hosts (RSC15), heartbeats, update events, whenState helper, and a connection lifecycle integration test.
Ensure mock WebSocket connections are properly closed in connection failure and open-failure test specs to prevent resource leaks in tests.
…kill Separate the mock WebSocket specification into its own file for reuse across test specs, and add a skill document for writing test specs.
Replace TRY/CATCH error characterisation patterns with declarative EXPECT_THROW assertions for clearer, more portable test specifications.
…ence Add UNIQUE_CHANNEL_NAME() calls and randomised channel names throughout the test specs. Also adds new test specs for channel attach (RTL4), detach (RTL6), channel options, state events, and channels collection.
Substantially rework the heartbeat test specs for better coverage of RTN23 (heartbeat monitoring) and extend the mock WebSocket helper with additional transport simulation capabilities. Update the write-test-spec skill with improved patterns.
Correct the test approach for RTN15a immediate reconnection behaviour and update the write-test-spec skill with refined patterns.
Correct small errors in channel_attach and channel_state_events specs.
Add test specs for channel connection state handling, channel error reporting, server-initiated detach, channel properties (RTL15/RTL16), connection ID/key (RTN8/RTN9), and connection ping (RTN13). Also adds a completion-status tracker for spec point coverage.
Add comprehensive test specs covering channel message subscription, filtering, listener management, and unsubscribe behaviour.
Add test specs covering channel message publishing, including message encoding, connection state requirements, and error handling.
… specs Add realtime test spec stubs for stats (RSC6a) and time (RSC16) that reference the existing REST test specs, since behaviour is identical.
Add test specs covering the Realtime.request() method for making arbitrary REST requests through the realtime client.
Add test coverage for message queueing during connection state changes, publish behaviour across different connection states, and message delivery ordering guarantees.
…istory) Add specs covering connection state recovery options and realtime channel history retrieval.
Add specs covering log level configuration, log handler callbacks, and default logging behaviour for REST and Realtime clients.
Complete the authentication test spec coverage with specs for token reauth, auth error handling, and edge cases.
Add comprehensive test specs covering presence enter, leave, update, subscribe, presence map synchronisation, and presence history.
Update test specs to use encode_uri_component() for channel names in URL paths, ensuring correct handling of special characters. Add a README documenting the convention and update the write-test-spec skill.
Refine presence test specs based on implementation experience, add integration test specs for presence operations against a live server, and fix various issues in the presence specs.
Extend the skill documentation to note the importance of keeping UTS portable test specs synchronised with language-specific tests.
Add specs covering the batch presence API for retrieving presence state across multiple channels in a single request.
Add specs covering the revokeTokens API for invalidating issued authentication tokens.
Add specs covering the handling of channel UPDATE protocol messages, including resumed and non-resumed flag behaviour.
Add specs covering delta compression for channel messages using the VCDIFF format, including encoding, decoding, and error recovery.
…connect Add test specs for channel attributes (RTL15), channel whenState helper, realtime client timeout configuration, auto-connect behaviour (RTC1b), and REST channel attributes.
Add specs covering the mutable messages feature including message update and delete operations, action fields, and event handling.
Add specs covering push notification administration including device registration management and push channel subscription management.
…P2h2b Fix several presence test spec issues: correct server echo expectations, handle wildcard clientId constraints, and fix RTL13b (presence SYNC) and RTP2h2b (presence re-entry) test logic.
Update REST integration test specs (auth, mutable messages, revoke tokens) to align assertions with actual Ably sandbox behaviour.
Realtime clients hold internal timers (retry, heartbeat, suspend) that keep test processes alive after assertions complete. Every test that creates a Realtime client must close it to release these handles. Adds CLOSE_CLIENT(client) after the final assertion in 50 spec files across realtime unit, integration, rest, and presence test specs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Apply fixes and implementation notes across 22 realtime UTS spec files based on findings from translating specs to ably-js tests. Key changes: - Fix presence assertions (action == ENTER → PRESENT per RTP2d2) - Add base64 encoding notes for JSON transport in delta decoding specs - Fix state change filtering in auth reauth tests (RTC8a/RTC8a1) - Add connectionStateTtl and disconnectedRetryTimeout to specs that transition through SUSPENDED or need fake timer precision - Add implementation notes for echo suppression, NACK alternatives, clientId:* restrictions, and REST API numeric action values - Add missing test sections (RTN14b, RTL5l, RTL5i notes) - Relax overly specific error code assertions (RSAN1a3) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Portable test specifications (UTS) for the Ably Realtime SDK, covering unit tests and direct sandbox integration tests. This builds on the REST test specs in
uts-rest.Scope
CLOSE_CLIENT()cleanup across all specsintegration-testing.mddefining the three-tier test structure (unit / integration / integration-proxy)69 files changed across 31 commits.
Does not include the test proxy framework or proxy-based integration tests — those will be a separate PR.
Test plan
completion-status.mdfor coverage gaps🤖 Generated with Claude Code