P2-9: Integration tests against a live cairnd in CI #29
Labels
No labels
data-integrity
engine
platform
procurement
remote
scaffold
ui
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Cordy/cairn-desktop#29
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Depends on P2-8. Closes phase 2.
Goal
Prove the client works against a real Cairn server, not just fakes. Every layer below this has been tested in isolation; this is the first test of the whole stack.
Files
.forgejo/workflows/interop.yml,test/integration/sync_test.goPattern to follow
The Cairn repo already does exactly this in
interop-rclone.yml,interop-tus.ymlandinterop-s3.yml. Copy the shape: start a realcairndin the job, run the client against it, assert on the outcome. Same runner constraints asci.yml— host mode, arch detection, no TTY.Job outline
cairndin the background with a temp POSIX storage root, local auth mode, one test user,enableWebdav: true. Wait for the port to answer before proceeding.cairnsync.cairnsync --once --json, asserting on output and on the state of both sides.Scenarios — each is a separate test
MOVE— not a DELETE plus PUT. Detect it by asserting the file's server-side ETag is unchanged, or by counting bytes transferred.ConflictName.cairnsyncmid-transfer of a large file, restart it, assert the file completes and fewer total bytes were transferred than a fresh upload.maxTotalBytes, exceed it, assert the client surfaces a quota skip and does not retry-loop.The one that matters most
Scenario 8. Interrupted transfers are where real users lose data and where fakes are least convincing. If only one scenario is fully rigorous, make it this one.
Steps
kubectl logs -n forgejo-runner deploy/forgejo-runner.git tag -a v0.2.0-integration -m "sync engine against a real Cairn server"phase-2-integrationmilestone.Acceptance criteria
cairndin CI.v0.2.0-integrationexists.Done
What was built
.forgejo/workflows/interop.yml+test/integration/sync_test.go: all 10 issue scenarios viacairnsync --once --jsonagainst a real cairnd bd006ef (anonymous Cordy/Cairn clone, two throwaway users, every state path + HOME in one mktemp dir), driven through a recording reverse proxy with an independent net/http oracle on both sides. Plus the whole-branch final-review fix wave: X1 re-reads a vouched local file before deleting or overwriting it; X2 refuses a pass when either side lists nothing but rows exist (--allow-emptyopt-in); X3 reclaims a SIGKILLed interop run's TMPDIR and processes; X4 never records a hash against a server copy cut short; X5 keeps a replaced file's permissions acrossOSFS.Write; X7 compares the runner's Linux cairnd answers against the committed capture.Tests
CI run(s) ci.yml: run #31 (id 2931, http://192.168.10.245/Cordy/cairn-desktop/actions/runs/31); interop.yml: run #32 (id 2932, http://192.168.10.245/Cordy/cairn-desktop/actions/runs/32) — both confirmed via runner env dump to have GITHUB_SHA=e4aead3be6b11287d3331be1d93e675892158ec8, coverage total: (statements) 90.2%. Integration suite: 18 PASS + 1 SKIP (twins, APFS-only host),
CGO_ENABLED=1 -raceclean, 10 mutation tables (M1–M10) killed for #29, 3 more for the fix wave (X1–X5).Acceptance criteria
$work, pre-clean stops orphaned processes); verified by a kill-and-rerun on the extracted step.v0.2.0-integrationexists — met, see below.Tag
v0.2.0-integration→ e4aead3.Rulings
integrationbuild tag, cairnd's documented deviations,perUserBytesfor quota, throwaway users only) — all confirmed at runtime in the suite.t.Skip, never a failure — see Server notes.Final review
Verdict: "ready to tag, with fixes." Two Important findings — X1 (a vouched local hash fed destructive local deletes/overwrites) and X2 (an empty side deleted every copy on the other) — plus five Minor (X3–X7), all landed in the fix wave (54bd91a..e4aead3), each test-first with a named mutant killed; ci.yml and interop.yml green afterward on
e4aead3.Server notes
For the owner (P2-R16, final review X7/X10): cairnd at bd006ef ignores
If-MatchandIf-None-Matchon PUT, DELETE and MOVE (verified by the integration suite), and returns no ETag on PUT or on tus finalize. The client's re-check just before each write narrows the concurrent-write window but cannot close it until the server honours conditional requests and returns ETags — both are worth a Cordy/Cairn issue. The three later-phase hand-off drafts (#34, #43, #44) await the owner's approval and are not part of this tag.Implemented and reviewed by Claude (subagent-driven), landed on main after review and green CI.