Skip to content

test: Cover command assembly, parallel splitting, and delta extraction - #6

Merged
kochj23 merged 2 commits into
mainfrom
test/coverage-improvements
Aug 18, 2026
Merged

test: Cover command assembly, parallel splitting, and delta extraction#6
kochj23 merged 2 commits into
mainfrom
test/coverage-improvements

Conversation

@kochj23

@kochj23 kochj23 commented Aug 18, 2026

Copy link
Copy Markdown
Owner

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 --itemize output (>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 multiple sent … bytes lines.

Parallel file-splitting strategies
The prior suite only replicated the byCount branch. Added byDirectory (top-level grouping + round-robin distribution + empty-batch filtering), bySizebyCount fallback, automatic == byCount, plus the empty-list and single-thread guards.

Rsync command assembly (both builders)

  • Scheduler path (ScheduleManager.buildRsyncCommand): shell-escaping of every argument, neutralization of a malicious destination, SSH -e "ssh -i <key>" transport bundling, and ~ expansion.
  • Executor path (RsyncExecutor.buildCommand): multi-source fan-in ordering, empty-source skipping, trailing-slash normalization, iCloud --exclude=*.icloud placement, remote user@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=macOSTEST SUCCEEDED, 24 passed, 0 failed.

Xcode project hygiene audit

Audited RsyncGUI.xcodeproj/project.pbxproj from a fresh clone for absolute paths, orphaned sources, and committed backup/corrupted copies.

  • All 51 .swift files on disk are attached to a target's Sources phase — no orphans.
  • No backup/corrupted pbxproj copies committed; only one project.pbxproj.
  • One defect found and fixed: NovaAPIServer.swift's PBXFileReference declared sourceTree = "<absolute>" while carrying a repo-relative path (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=NOBUILD SUCCEEDED from a fresh clone, and CommandBuilderTestsTEST SUCCEEDED.

🤖 Generated with Claude Code

kochj23 and others added 2 commits August 18, 2026 14:50
…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
@kochj23
kochj23 merged commit 0f01031 into main Aug 18, 2026
1 check passed
@kochj23
kochj23 deleted the test/coverage-improvements branch August 18, 2026 22:04
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