mirror of
https://github.com/sotashimozono/obsidian-remote-ssh.git
synced 2026-07-22 17:10:32 +00:00
Closes #109. Brings the Phase C E2E suite from 8/9 cases to 9/9 by adding the disconnect/queue/reconnect case and deepening two existing cases per the issue spec. ## What changed in plugin/tests/integration/sync.e2e.test.ts - "large file (1 MB)" → "large file (10 MB)". The issue specs 10 MB to push the wire-transfer envelope and verify the daemon doesn't time out on long writes. Budget multiplier bumped 5x → 20x for proportional headroom on slow CI links (~50 MB/s effective sftp throughput → ~200 ms transfer + reader's fs.changed → stat round-trip). - 3-way conflict deepened. The pre-existing test only asserted the daemon rejects with PreconditionFailed (-32020). The new variant wires a real ConflictResolver + AncestorTracker on a third "Bob" adapter and verifies the full pipeline: Alice creates "version-1" (becomes Bob's ancestor) Bob reads → ancestor remembered Alice overwrites with "alice-edit" (becomes "theirs" on Bob) Bob writes "bob-edit" → PreconditionFailed → ConflictResolver.resolve → onTextConflict({ancestor,mine,theirs}) → stub returns keep-mine Remote ends up holding "bob-edit" This is the production wiring used by ThreeWayMergeModal — the old test only proved the daemon rejects, not that the resolver chain runs end-to-end. - New: "disconnect → queue → reconnect" case. Pre-populates an OfflineQueue with mkdir + 3 writes and runs QueueReplayer against the connected writerAdapter. Asserts: - report.errors === [] - report.drained === ops.length - queue is empty after drain - all 4 paths land on the reader's FakeFileExplorer Validates F3 (offline queue) + F6 (replay) + F19 (in-order delivery) from the plan's functional matrix. The "forcibly close the SSH socket" half of the spec is AdapterManager orchestration already covered by unit tests; this integration assertion is the one the unit suite can't make (queued ops surfacing as fs.changed events on the reader's vault). ## Imports added - node:os + node:path (for the queue's tmp directory) - ConflictResolver, ThreeWayPanes, AncestorTracker - OfflineQueue, QueuedOp, QueueReplayer ## Verified locally - tsc --noEmit clean - npm run lint clean - vitest run (unit suite) 780 pass / 1 Windows-skipped (integration tests don't run under `vitest run`; they're routed through vitest.integration.config.ts and require Docker test sshd) ## CI The new integration tests will run under the `SSH integration` job in .github/workflows/integration.yml, which spins up the Docker test sshd. Local Windows can't exercise them; CI is the verification path. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| helpers | ||
| daemon.deploy.test.ts | ||
| multiclient.rpc.test.ts | ||
| multiclient.sftp.test.ts | ||
| perf.sync.bench.test.ts | ||
| ssh.integration.test.ts | ||
| sync.e2e.test.ts | ||
| walk.equivalence.test.ts | ||