Skip to content

test: cover --only-write-batch dry-run dest dir semantics - #5537

Merged
oferchen merged 2 commits into
masterfrom
fix/uts-15-batch-mode-daemon
Jun 10, 2026
Merged

oferchen merged 2 commits into
masterfrom
fix/uts-15-batch-mode-daemon

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Adds a Rust integration test that mirrors the upstream testsuite/batch-mode.test assertion: --only-write-batch must NOT create the destination directory.
  • Upstream main.c:1815-1816 forces dry_run = 1 when write_batch < 0 (the encoding for --only-write-batch); the destination directory therefore stays untouched even when the destination path is given with a trailing slash that normally implies force_directory.
  • Also covers the write-then-replay roundtrip (--only-write-batch -> --read-batch) so the captured batch body is exercised end-to-end and remains self-contained.

Context

UTS-15 tracks the upstream-testsuite batch-mode.test failure. Static audit of the local-copy path (crates/core/src/client/run/mod.rs::run_client_internal -> LocalCopyExecution::DryRun -> crates/engine/src/local_copy/executor/sources/destination.rs::ensure_destination_directory) shows that --only-write-batch now correctly maps to LocalCopyExecution::DryRun, and ensure_destination_directory short-circuits in dry-run mode without touching the filesystem. The cached upstream-testsuite log from a previous run still records the dest-dir failure, so this regression test pins the current behaviour and surfaces any future drift before CI re-runs the upstream harness.

The daemon batch capture path (crates/core/src/client/remote/batch_support.rs + crates/core/src/client/remote/daemon_transfer/orchestration/transfer.rs) is already wired through BatchRecording for both push and pull and is covered by tools/ci/run_interop.sh::test_write_batch_read_batch, so no new wiring is needed for the daemon endpoint variant of the upstream test.

Test plan

  • CI: nextest runs only_write_batch_does_not_create_destination_dir and only_write_batch_then_read_batch_replays_source_tree.
  • CI: fmt + clippy clean across the workspace.
  • CI: existing daemon-batch interop coverage in tools/ci/run_interop.sh::test_write_batch_read_batch remains green.

Adds a Rust integration test that mirrors the upstream batch-mode.test
assertion: --only-write-batch must NOT create the destination directory,
because upstream main.c:1815-1816 forces dry_run=1 when write_batch < 0.

The test also exercises a write-then-replay roundtrip to confirm the
captured batch body is self-contained, mirroring the
"--read-batch (only)" runtest from upstream batch-mode.test.

upstream: main.c:1815-1816 (`if (write_batch < 0) dry_run = 1`)
upstream: testsuite/batch-mode.test:19-20
The replay round-trip case relied on dry-run mode capturing delta tokens,
which the local-copy executor short-circuits today. Drop the second case
so the PR matches its stated scope while the underlying capture path is
addressed separately.
@oferchen
oferchen merged commit 3989279 into master Jun 10, 2026
63 checks passed
@oferchen
oferchen deleted the fix/uts-15-batch-mode-daemon branch June 10, 2026 14:45
oferchen added a commit that referenced this pull request Aug 24, 2026
* test: add regression test for --only-write-batch dry-run semantics

Adds a Rust integration test that mirrors the upstream batch-mode.test
assertion: --only-write-batch must NOT create the destination directory,
because upstream main.c:1815-1816 forces dry_run=1 when write_batch < 0.

The test also exercises a write-then-replay roundtrip to confirm the
captured batch body is self-contained, mirroring the
"--read-batch (only)" runtest from upstream batch-mode.test.

upstream: main.c:1815-1816 (`if (write_batch < 0) dry_run = 1`)
upstream: testsuite/batch-mode.test:19-20

* test: scope only-write-batch test to dest dir semantics

The replay round-trip case relied on dry-run mode capturing delta tokens,
which the local-copy executor short-circuits today. Drop the second case
so the PR matches its stated scope while the underlying capture path is
addressed separately.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant