ci: Add integration test timeouts and download progress monitoring#37
Conversation
Add job-level (90 min) and step-level (75 min) timeouts to prevent integration tests from hanging indefinitely when Plex server downloads stall on ubuntu runners. Add Start-SyncProgressMonitor/Stop-SyncProgressMonitor helpers that poll the destination directory every 30 seconds and emit file count and total MB to CI logs, giving visibility into download progress. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds job- and step-level timeout settings to the integration-tests CI job and introduces Start-SyncProgressMonitor / Stop-SyncProgressMonitor functions used by integration tests to log periodic file-sync progress and final completion time. Changes
Sequence DiagramsequenceDiagram
actor TestRunner as Test Runner
participant Monitor as SyncProgressMonitor
participant Timer as System.Timers.Timer
participant Sync as Sync-PatMedia
participant FS as File System
TestRunner->>Monitor: Start-SyncProgressMonitor(path, interval)
Monitor->>Timer: Create & Start (interval)
Note right of Timer: Timer ticks every interval
TestRunner->>Sync: Invoke Sync-PatMedia(...)
Sync->>FS: Download/Create files
activate Sync
loop every interval
Timer->>FS: Scan destination path
FS-->>Timer: Return files & sizes
Timer->>Monitor: Log "[SYNC PROGRESS]" with totals
end
Sync->>FS: Finish downloads
deactivate Sync
TestRunner->>Monitor: Stop-SyncProgressMonitor(monitor)
Monitor->>Timer: Stop & Dispose
Monitor->>TestRunner: Log "[SYNC COMPLETE]" with elapsed time
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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
This PR improves CI reliability and debuggability for the media sync integration tests by adding workflow timeouts and emitting periodic download progress to the job logs.
Changes:
- Add job- and step-level timeouts to the GitHub Actions integration-tests workflow to prevent indefinite hangs.
- Introduce
Start-SyncProgressMonitor/Stop-SyncProgressMonitorhelpers to periodically log file count and downloaded size while syncing media. - Wrap the
Sync-PatMediadownload and idempotency integration tests with the progress monitor.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
tests/Integration/Public/MediaSync.Integration.tests.ps1 |
Wraps long-running sync tests with a progress monitor to improve CI log visibility. |
tests/Integration/IntegrationTestHelpers.psm1 |
Adds and exports progress monitor helpers used by integration tests. |
.github/workflows/CI.yaml |
Adds timeouts to integration test job/step to prevent long hangs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Register-ObjectEvent -Action returns a PSEventJob whose .Name is the job name, not the SourceIdentifier needed by Unregister-Event. Use an explicit -SourceIdentifier with a unique GUID and store that instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The [Unreleased] section had drifted empty even though user-facing work landed since 0.10.3. Backfill the entries so the next release captures them and so users browsing the changelog can see what's coming. - Added: Update-PatServerToken (#31) — interactive/direct token refresh with vault or inline storage and post-update verification - Added: CI integration token validation pre-flight step (#31) — fast actionable failure when PLEX_TOKEN is expired - Changed: actionable 401 token recovery guidance from this PR (#39) Pure CI/dev-tooling churn (#34/#35/#36/#37/#38) intentionally omitted — Keep a Changelog focuses on user-facing changes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat: Replace 401 errors with actionable token recovery guidance Plex API 401 responses now throw a message naming the cmdlets users can run to recover (Update-PatServerToken, Get-PatStoredServer, -Token) instead of bubbling up the raw HTTP status. Detection happens centrally in Invoke-PatApi so every public cmdlet that hits the Plex API benefits. Also fixes a latent test that constructed a [WebException] with an invalid 4-arg overload — the constructor failure was masking the assertion. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * refactor: Tighten 401 detection and preserve original error context Address review feedback on PR #39: - Drop the lone 'Unauthorized' regex clause; rely on \b401\b alone. Bare 'Unauthorized' could misfire on UnauthorizedAccessException, 403 bodies that include the word, proxy/auth middleware errors, etc., and then incorrectly recommend Plex token recovery. - Append 'Original error: <message>' to the 401 guidance so URL/inner- exception detail is retained for support and debugging. - Tighten the raw-string 401 test to also assert on Update-PatServerToken so the cmdlet-naming contract is enforced for both message shapes. - Add a regression test asserting that an UnauthorizedAccessException- style message does NOT trigger the 401 guidance. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs: Backfill [Unreleased] changelog entries The [Unreleased] section had drifted empty even though user-facing work landed since 0.10.3. Backfill the entries so the next release captures them and so users browsing the changelog can see what's coming. - Added: Update-PatServerToken (#31) — interactive/direct token refresh with vault or inline storage and post-update verification - Added: CI integration token validation pre-flight step (#31) — fast actionable failure when PLEX_TOKEN is expired - Changed: actionable 401 token recovery guidance from this PR (#39) Pure CI/dev-tooling churn (#34/#35/#36/#37/#38) intentionally omitted — Keep a Changelog focuses on user-facing changes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
timeout-minutes: 90to the integration tests job andtimeout-minutes: 75to the "Run Integration Tests" step to prevent indefinite hangs when Plex server downloads stallStart-SyncProgressMonitor/Stop-SyncProgressMonitorhelper functions that poll the download destination every 30 seconds and emit[SYNC PROGRESS]lines to CI logs with elapsed time, file count, and total MBSync-PatMediadownload and idempotency tests with the progress monitor for CI visibilityTest Plan
[SYNC PROGRESS]lines during the media download test[SYNC COMPLETE]line with total time after download finishes🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Tests
Chores