Increase CI-safe test coverage#28
Conversation
There was a problem hiding this comment.
Pull request overview
This PR expands CI-safe test coverage across SwiftVLC’s higher-level wrappers (Player, PiP, thumbnails, discovery, dialog registration, playlists, and equalizer), focusing on edge cases and cancellation/branch behavior that’s hard to hit in headless CI. All changes are in the test target only.
Changes:
- Add new/extended integration & logic tests for playback state transitions, event mapping, PiP controllers/backends, and pixel-buffer rendering paths.
- Add thumbnail coordination + cancellation coverage (including queued acquisition and already-cancelled tasks).
- Add validation/edge-case tests for discovery init, dialog registration slotting, playlist play input validation, and equalizer error handling.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Tests/SwiftVLCTests/Playlist/MediaListPlayerRebuildTests.swift | Adds coverage for MediaListPlayer.play(at:) input validation and basic play/stop paths. |
| Tests/SwiftVLCTests/Player/PlayerWithMediaBranchTests.swift | Adds branch coverage for media replacement via play(_:) when cached state is active. |
| Tests/SwiftVLCTests/Player/PlayerThrowsTests.swift | Adds an error-path test for deinterlace mode handling. |
| Tests/SwiftVLCTests/Player/PlayerEventHandlerTests.swift | Adds coverage for additional event→observable-state mutations and native state sync helpers. |
| Tests/SwiftVLCTests/Player/PlayerBranchCoverageTests.swift | Extends no-crash branch coverage for selectProgram(id:) with extreme IDs. |
| Tests/SwiftVLCTests/Player/MapEventTests.swift | Adds mapping tests for audio device, recording, and snapshot libVLC event payloads. |
| Tests/SwiftVLCTests/PiP/PixelBufferRendererTests.swift | Adds coverage for render-generation stability, pool reuse, and unallocatable scaling behavior. |
| Tests/SwiftVLCTests/PiP/PixelBufferRendererCallbackTests.swift | Adds callback coverage for timebase-driven presentation timestamps. |
| Tests/SwiftVLCTests/PiP/PiPVideoViewTests.swift | Adds macOS PiP backend/media-controller edge-case coverage. |
| Tests/SwiftVLCTests/PiP/PiPControllerInteractionTests.swift | Adds coverage for deferred pause retry, external intent supersession, and deinit cleanup branching. |
| Tests/SwiftVLCTests/Media/TrackExtendedTests.swift | Adds coverage for C subtitle track encoding mapping and field clearing. |
| Tests/SwiftVLCTests/Media/ThumbnailCoordinatorTests.swift | New tests for queued acquisition, cancellation while waiting, and skipped cancelled waiters. |
| Tests/SwiftVLCTests/Media/ThumbnailCancellationTests.swift | Adds CI-safe completion/failure coverage for audio-only/video thumbnail requests and already-cancelled tasks. |
| Tests/SwiftVLCTests/Media/MediaErrorPathsTests.swift | Adds coverage for cancelled parse behavior (typed failure shape). |
| Tests/SwiftVLCTests/Discovery/RendererDiscovererTests.swift | Adds init-with-empty-name error-path coverage. |
| Tests/SwiftVLCTests/Discovery/MediaDiscovererTests.swift | Adds init-with-empty-name error-path coverage. |
| Tests/SwiftVLCTests/Core/VLCInstanceTests.swift | Adds dialog registration slot claiming/releasing + deinit cleanup coverage. |
| Tests/SwiftVLCTests/Core/InputValidationTests.swift | Adds coverage for checkedNonnegativeInt32 success cases. |
| Tests/SwiftVLCTests/Core/DialogHandlerExtendedTests.swift | Adds coverage for rejecting unrepresentable QuestionRequest actions. |
| Tests/SwiftVLCTests/Audio/EqualizerBandsTests.swift | Adds coverage for rejecting NaN amplification values. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 23 out of 23 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
MediaListPlayerso index/item playback fails withinvalidStatewhen no media list is attached instead of forwarding the invalid state to libVLC.Verification
Remaining coverage constraints
The largest remaining uncovered areas are private macOS PiP integration, libVLC callback-only dialog/thumbnail/renderer paths, renderer items that require real libVLC-owned pointers, and live playback / structured-media paths that are intentionally skipped in CI to avoid audio/video-output instability.