Priority: P2 · Epic: #82
Why
crates/cli/tests/examples_suite.rs proves primitives inside this repo, but a module in
another repository has no way to run the same before/after snapshot discipline against
itself. Module authors need "apply on before/ equals after/, check on after/
exits 0, check on before/ exits 2" as a one-command test.
What
wvr module test [<module-dir>] [--case <name>] [--update]: for each
tests/cases/<name>/ with before/, after/, and weaver.yaml (consumer config
whose module source: is the module under test), copy before/ to a temp dir, run
check (expect exit 2 unless expect_pass: true in case.yaml), run apply, diff
against after/ (ignore weaver.lock, .rw/), run check again (expect 0), run
plan --detailed-exitcode (expect 0). --update rewrites after/.
- The examples harness in this repo reuses the same core so behaviour cannot drift.
- Reusable workflow
.github/workflows/module-ci.yml (workflow_call): installs wvr
(pinned), runs wvr module validate and wvr module test, uploads the JSON
reports. Module repos call it with three lines.
Acceptance
Depends on
#83, #77, #73.
Priority: P2 · Epic: #82
Why
crates/cli/tests/examples_suite.rsproves primitives inside this repo, but a module inanother repository has no way to run the same before/after snapshot discipline against
itself. Module authors need "apply on
before/equalsafter/, check onafter/exits 0, check on
before/exits 2" as a one-command test.What
wvr module test [<module-dir>] [--case <name>] [--update]: for eachtests/cases/<name>/withbefore/,after/, andweaver.yaml(consumer configwhose module
source:is the module under test), copybefore/to a temp dir, runcheck(expect exit 2 unlessexpect_pass: trueincase.yaml), runapply, diffagainst
after/(ignoreweaver.lock,.rw/), runcheckagain (expect 0), runplan --detailed-exitcode(expect 0).--updaterewritesafter/..github/workflows/module-ci.yml(workflow_call): installswvr(pinned), runs
wvr module validateandwvr module test, uploads the JSONreports. Module repos call it with three lines.
Acceptance
wvr module newscaffold, module authoring guide, and self-describing manifest #83 passeswvr module testin a fresh clone.wvr module testagainst a fixture module with one failingcase and asserts the diff output names the file.
Depends on
#83, #77, #73.