Skip to content

Improve test coverage#923

Draft
pblazej wants to merge 14 commits intomainfrom
blaze/cov
Draft

Improve test coverage#923
pblazej wants to merge 14 commits intomainfrom
blaze/cov

Conversation

@pblazej
Copy link
Contributor

@pblazej pblazej commented Feb 20, 2026

Mostly to capture current Room/SignalClient behavior and make regression tracking easier.

pblazej and others added 9 commits February 20, 2026 11:08
…on tests

Add 53 new unit tests covering Room's engine delegate state machine,
data packet/transcription/RPC handling, and RemoteTrackPublication
internals. Uses delegate trackers with async-aware XCTestExpectation
to handle MulticastDelegate's async dispatch. Extends TestData with
userPacket, transcription, and roomState fixture builders.

Coverage: 43.1% -> 48.1% overall, 57.4% hand-written (excl protos)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add RoomTestHelper (Android MockRoom equivalent) for simulating server
  events without WebSocket/WebRTC dependencies
- Add SignalClientDispatchTests (21 tests) verifying _process pipeline
  dispatches all response types correctly through Room delegate
- Expand RoomSignalDelegateTests (+16 tests) covering subscription
  permissions, stream states, room moved, remote mute, and edge cases
- Extend TestData with signal response builders for all message types
- Make SignalClient._process internal and add setConnectionState() for
  test access across actor boundary

Coverage: 48.9% overall (15,239/31,155), 58.1% hand-written code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… tests

- Add 20+ tests to ParticipantStateTests: getTrackPublication, convenience
  booleans, Participant+Convenience properties, isAgent, agent state,
  permissions, enabledPublishCodecs, cleanUp
- Add 15+ tests to RemoteTrackPublicationTests: isSubscribePreferred,
  stream state, isSendingTrackSettings, TrackSettings.copyWith, multiple
  publications, updateFromInfo edge cases, latestInfo storage
- Add RingBufferTests (14 tests): write, read, wrap-around, sequences,
  size-1 edge case, float type support
- Add UtilsTests: computeAttributesDiff with add/remove/change/no-change

Coverage: 49.4% overall (15,381/31,155), 473 tests passing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Feb 20, 2026

⚠️ This PR does not contain any files in the .changes directory.

pblazej and others added 5 commits February 20, 2026 14:26
- Add WebSocketType protocol to abstract WebSocket for testing
- Add MockWebSocket that captures sent protobuf messages
- Add WebSocket factory injection to SignalClient for connect() testing
- Add test helpers for WebSocket message handling and ping timers
- Add SignalClientSendTests (43 tests covering all send methods)
- Extend SignalClientDispatchTests with 7 new response dispatch tests
- Add LiveKitWebRTC dependency to test targets in Package.swift

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add SessionTests: token sources, message history, error handling (16 tests)
- Extend AgentStateTests with connected(participant:) state coverage (8 tests)
- Add ParticipantConvenienceTests: camera/screen/audio publications,
  agent kind/state, encryption type, avatarWorker (24 tests)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add StatisticsTests: enum raw values, all Statistics subclass
  initializers (Codec, Transport, ICE, RTP streams), dictionary
  read helpers, ridIndex sorting (34 tests)
- Add AudioEncodingTests: equality, hashing, presets, plus
  VideoEncoding/VideoParameters Comparable operators (16 tests)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add StopwatchTests: init, split, total, equality, description (9 tests)
- Add MapTableTests: CRUD, weak refs, enumerator (6 tests)
- Add HTTPTests: connection refused and prewarm paths (2 tests)
- Add AsyncTryMapSequenceTests: transform, error propagation (3 tests)
- Extend RoomTestHelper with processSignalResponse helper

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use optional params with nil defaults for protobuf enum default
  arguments in TestData and RoomTestHelper (Swift 5.9 rejects internal
  enum cases in default argument values across modules)
- Replace force casts with XCTUnwrap in RemoteTrackPublicationTests
- Replace force try with throwing test in SignalClientSendTests
- Suppress file_length/type_body_length in large test classes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant