test: Cover command assembly, parallel splitting, and delta extraction - #6
Merged
Conversation
…traction Adds CommandBuilderTests covering high-risk, previously under-tested deterministic logic: - Delta report filename extraction: existing tests only asserted change counts; these pin the actual extracted paths from rsync --itemize output, directory-line filtering, size-only non-detection, and multi-line byte accumulation (exercises the real generateDeltaReport API). - Parallel file-splitting strategies byDirectory / bySize / automatic and the empty/single-thread guards (previously only the byCount branch was covered). - Full rsync command assembly for both the scheduler (ScheduleManager) and executor (RsyncExecutor) paths: SSH -e transport bundling, remote user@host: prefixing and idempotency, trailing-slash normalization, iCloud .icloud placeholder exclusion, tilde expansion, and shell escaping of malicious destinations. 24 tests, all green via xcodebuild test on platform=macOS. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QrPsErCe9kBuRRPyDSA5cF
…urceTree NovaAPIServer.swift's PBXFileReference declared sourceTree = "<absolute>" while carrying a repo-relative path (RsyncGUI/NovaAPIServer.swift). This is malformed (absolute sourceTree with a relative path) and inconsistent with every sibling source file, which use sourceTree = "<group>". Left as-is it can misresolve in the Xcode GUI or in a checkout at a different location. Changed to sourceTree = "<group>" to match siblings. The file was already correctly attached to the app target's Sources phase and PBXGroup, so this is purely a hygiene fix. Verified a clean build and CommandBuilderTests pass from a fresh clone. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QrPsErCe9kBuRRPyDSA5cF
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
Adds
RsyncGUITests/CommandBuilderTests.swift(24 tests) targeting high-risk, deterministic logic that was under-covered by the existing ~403-test suite. No production code changed; tests only.Areas covered
Delta report filename extraction (real
AdvancedExecutionService.generateDeltaReport)Existing delta tests asserted only counts. These pin the actual extracted path values from rsync
--itemizeoutput (>f+++,>f.st/>f..t,*deleting), verify directory (cd+++) lines are ignored, that a size-only (>f.s) change is not counted as modified (documents current behavior), and that byte totals accumulate across multiplesent … byteslines.Parallel file-splitting strategies
The prior suite only replicated the
byCountbranch. AddedbyDirectory(top-level grouping + round-robin distribution + empty-batch filtering),bySize→byCountfallback,automatic==byCount, plus the empty-list and single-thread guards.Rsync command assembly (both builders)
ScheduleManager.buildRsyncCommand): shell-escaping of every argument, neutralization of a malicious destination, SSH-e "ssh -i <key>"transport bundling, and~expansion.RsyncExecutor.buildCommand): multi-source fan-in ordering, empty-source skipping, trailing-slash normalization, iCloud--exclude=*.icloudplacement, remoteuser@host:prefixing and idempotency, and identity-flag omission when no key is set.Command builders are
private, so — matching this suite's established convention — their exact logic is replicated and pinned; the delta and dependency assertions call the real public APIs.Test result
xcodebuild test -only-testing:RsyncGUITests/CommandBuilderTests -destination platform=macOS→ TEST SUCCEEDED, 24 passed, 0 failed.Xcode project hygiene audit
Audited
RsyncGUI.xcodeproj/project.pbxprojfrom a fresh clone for absolute paths, orphaned sources, and committed backup/corrupted copies..swiftfiles on disk are attached to a target's Sources phase — no orphans.project.pbxproj.NovaAPIServer.swift'sPBXFileReferencedeclaredsourceTree = "<absolute>"while carrying a repo-relativepath(RsyncGUI/NovaAPIServer.swift), inconsistent with every sibling (<group>). Repointed to<group>. The file was already correctly wired into the app target, so this is purely hygiene.xcodebuild build -project RsyncGUI.xcodeproj -scheme RsyncGUI -destination platform=macOS CODE_SIGNING_ALLOWED=NO→ BUILD SUCCEEDED from a fresh clone, andCommandBuilderTests→ TEST SUCCEEDED.🤖 Generated with Claude Code