Skip to content

Increase CI-safe test coverage#28

Merged
omaralbeik merged 5 commits into
mainfrom
increase-test-coverage-round-2
May 5, 2026
Merged

Increase CI-safe test coverage#28
omaralbeik merged 5 commits into
mainfrom
increase-test-coverage-round-2

Conversation

@omaralbeik
Copy link
Copy Markdown
Member

@omaralbeik omaralbeik commented May 5, 2026

Summary

  • Add CI-safe coverage across thumbnail coordination/cancellation, PiP playback state handling, pixel-buffer rendering, player event handling, libVLC event mapping, dialog/VLC instance registration, media/discovery edge cases, playlist validation, and equalizer error handling.
  • Include a small production guard fix for MediaListPlayer so index/item playback fails with invalidState when no media list is attached instead of forwarding the invalid state to libVLC.
  • Push local CI-mode source coverage to 89.19% in the exported lcov report.

Verification

  • /opt/homebrew/bin/swiftformat Sources Tests Showcase --lint --strict
  • /opt/homebrew/bin/swiftlint lint --strict --quiet Sources Tests Showcase
  • CI=1 xcrun swift test --no-parallel --enable-code-coverage (1394 tests in 109 suites)
  • scripts/export-lcov.sh

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.

Copilot AI review requested due to automatic review settings May 5, 2026 10:39
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread Tests/SwiftVLCTests/Player/PlayerThrowsTests.swift Outdated
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread Sources/SwiftVLC/Playlist/MediaListPlayer.swift
Comment thread Sources/SwiftVLC/Playlist/MediaListPlayer.swift
Comment thread Sources/SwiftVLC/Playlist/MediaListPlayer.swift
@omaralbeik omaralbeik merged commit c8afb59 into main May 5, 2026
9 checks passed
@omaralbeik omaralbeik deleted the increase-test-coverage-round-2 branch May 5, 2026 12:11
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.

3 participants