Skip to content

wvr module test: before/after fixture harness for external module repos + reusable CI workflow #84

Description

@Max-Levitskiy

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

  1. 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/.
  2. The examples harness in this repo reuses the same core so behaviour cannot drift.
  3. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions