MindAttic.Deploy/rfc/0001-test-harness
Appearance
RFC 0001 — A test harness for the deploy pipeline
Problem
The repo ships a real deploy pipeline (src/deploy.js, src/linked.js, the C# CLI). npm test (node:test, test/linked.test.js) covers the linked deploy and the CLI flag guards against throwaway git repos, a local CDN stand-in and a fake FTP, but the plain site/app modes and the C# CLI have no automated tests. Per HOUSE-LAW-8 and M.DPLY-§8, behaviors can only be marked ✅ when a test or build proves them, so most user stories are still 🟡. We want behaviors to graduate to ✅ without requiring a live FTP server or a real git push.
Options compared
- Node test runner (
node:test) on the pure functions. TestexpandFilesglob escaping,stampIndexidempotency, flag rejection, andsubstitute. Zero new deps, no network. Downside: requires light refactoring to export the pure functions fromsrc/deploy.js. - C# xUnit project for the CLI. Tests argument→
DeployRunnerwiring andProjectRosterloading. Natural fit fordotnet test, but covers only the thin C# shell, not the engine where logic lives (M.DPLY-LAW-1). - End-to-end against a mock FTP server + a throwaway git remote. Highest fidelity, highest cost/flakiness; better as a later CI smoke step.
Decision
Start with Option 1 for the engine (where the logic is) plus a thin slice of Option 2 for the CLI wiring. Defer Option 3 to a CI smoke step (backlog item M.DPLY-US-F3).
What NOT to do
- Do NOT duplicate deploy logic into the C# CLI just to make it testable — logic stays in
src/deploy.js(M.DPLY-LAW-1). - Do NOT require live FTP credentials or real pushes in the default test run.
- Do NOT add heavy test frameworks to the Node side; use the built-in
node:test.
Phased plan (with risk)
- Extract the pure helpers into a small importable module without changing runtime behavior. Risk: accidental behavior change — mitigate by keeping the CLI entrypoints byte-identical in output.
- Add
node:testcases for those helpers next totest/linked.test.js(npm testis already wired). Risk: low. - Add a minimal xUnit project for
ProjectRoster.Load+DeployRunnerarg assembly; wire intoMindAttic.Deploy.slnx. Risk: low. - (Later) CI smoke deploy against a mock FTP server. Risk: flakiness — keep it a separate, non-blocking job.
Graduates into
- BIBLE.md §6 — Verified state (promote proven capabilities to ✅).
- USER_STORIES.md Epics A, C and D (cite the new test names) and backlog items M.DPLY-US-F1/F2/F3.
Part of MindAttic.Deploy.
From MindAttic.Deploy/docs/rfc/0001-test-harness.md via MindAttic.Docs; synced automatically, so edit the repo, not this page.