Repository navigation
test: cover --only-write-batch dry-run dest dir semantics - #5537
Merged
Merged
Conversation
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
2 tasks
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
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.
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
testsuite/batch-mode.testassertion:--only-write-batchmust NOT create the destination directory.main.c:1815-1816forcesdry_run = 1whenwrite_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 impliesforce_directory.--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.testfailure. 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-batchnow correctly maps toLocalCopyExecution::DryRun, andensure_destination_directoryshort-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 throughBatchRecordingfor both push and pull and is covered bytools/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
nextestrunsonly_write_batch_does_not_create_destination_dirandonly_write_batch_then_read_batch_replays_source_tree.tools/ci/run_interop.sh::test_write_batch_read_batchremains green.