Skip to content

test: cover transfer-helper scan/repair/CLI and agent terminal, reaper, fsevent paths - #68

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1786554326-transfer-helper-agent-tests
Open

test: cover transfer-helper scan/repair/CLI and agent terminal, reaper, fsevent paths#68
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1786554326-transfer-helper-agent-tests

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Summary

cargo llvm-cov --workspace showed the transfer-helper crate almost entirely untested (scan_linux.rs, repair_linux.rs, main.rs all at 0%) plus three thin spots in the agent. This adds unit tests only; workspace line coverage goes 76.27% → 87.83% (regions 76.06% → 87.61%).

Per-module before → after (lines):

module before after
transfer-helper/src/scan_linux.rs 0% 84.7%
transfer-helper/src/repair_linux.rs 0% 84.2%
transfer-helper/src/main.rs 0% 91.8%
transfer-helper/src/lib.rs ~59% 98.7%
agent/src/terminal.rs ~26% 89.4%
agent/src/vsock_server.rs ~4% 57.4%
agent/src/reaper.rs ~23% 69.7%

What the tests exercise:

  • scan/repair: entry ordering and hashes, sparse extents, hard-link canonicalization, symlinks/FIFOs/sockets, xattrs, entry-count and path-length limits, source drift, repair convergence and metadata/hole restoration, device-node policy, and each transport verification failure (missing, renamed, wrong type, altered content).
  • transfer-helper CLI: scanrepair round trip through a manifest file, usage errors, manifest canonicality/size/hard-link rejection, and atomic .partial replacement.
  • agent terminal: serve_shell_stream over a UnixStream pair — output flows both ways, the session ends on shell exit and on client close — plus the injected TERM and the raw fd helper error paths.
  • agent reaper: exec waits and the PID-1 sweep share one lock (exclusion verified), and start_pid1_reaper_if_needed is a no-op off PID 1 (an unrelated child stays waitable by its spawner).

Two non-behavioral production touches were needed:

  • handle_fsevent_batch is now generic over the stream, so its framing/limit/deadline logic can be driven by tokio::io::duplex instead of a real vsock connection (unavailable off a guest):
    -async fn handle_fsevent_batch(mut stream: tokio_vsock::VsockStream, ...)
    +async fn handle_fsevent_batch<S>(mut stream: S, ...) where S: AsyncRead + AsyncWrite + Unpin
  • New transfer-helper/src/test_support.rs (test-only) builds throwaway volumes. It probes whether TMPDIR supports user.* xattrs and falls back to target/dory-transfer-tests when it doesn't, and keeps volume paths short (v<pid>-<n>) because the socket tests would otherwise exceed SUN_LEN.

scripts/test.sh rust (fmt, clippy -D warnings, full workspace tests) passes. The remaining zero-coverage files are process entrypoints (agent/src/main.rs, runc-wrapper/src/main.rs); Swift/Xcode coverage was not measured since it needs macOS.

Link to Devin session: https://app.devin.ai/sessions/7817d379e16e467594e0f0fca962cf82
Requested by: @Augani

…r, fsevent paths

Co-Authored-By: Augustus Otu <Augani7@gmail.com>
@Augani Augani self-assigned this Aug 12, 2026
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

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