You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement gonext plugin test — the contract test runner. Loads the plugins WASM in-process against a fake host (in-memory KV, pgmock Postgres, recorded HTTP), runs the plugin authors tests. Lets plugin authors get end-to-end-ish testing without docker.
Shipped as a Go library sdk-go/wptest plus a CLI wrapper.
Design reference
docs/02-plugin-system.md §11.4
Acceptance criteria
Package github.com/gonext/sdk-go/wptest with wptest.NewHost(t) returning an in-process fake host
Fake host implements the FULL host ABI surface: db (in-memory or pgmock), kv (in-memory), http (recorded responses fixture file), email (captured to a slice), media (in-memory), users (test fixture), secrets (test fixture), audit (collected to a slice), cron (manually fire-able)
h.LoadPlugin(path) error instantiates the WASM via wazero with the test host
h.ApplyFilter(name, value, args...), h.DoAction(name, args...): drives the hook bus
h.FireCron(name): manually fires a declared cron job
h.SetSecret(plugin, key, val): pre-populates test secrets
h.AssertAuditEmitted(event, matcher): assertion helper for audit events
gonext plugin test [dir] CLI: runs the plugin authors tests (go test ./... for Go plugins, cargo test for Rust, npm test for TS), all using the same fake host
Contract conformance suite: a shared set of "every plugin must pass these" tests (e.g., manifest validates, all declared exports exist, no banned imports, msgpack round-trips)
Tests: the SEO sample plugin passes the conformance suite end-to-end
Summary
Implement
gonext plugin test— the contract test runner. Loads the plugins WASM in-process against a fake host (in-memory KV,pgmockPostgres, recorded HTTP), runs the plugin authors tests. Lets plugin authors get end-to-end-ish testing without docker.Shipped as a Go library
sdk-go/wptestplus a CLI wrapper.Design reference
Acceptance criteria
github.com/gonext/sdk-go/wptestwithwptest.NewHost(t)returning an in-process fake hostpgmock), kv (in-memory), http (recorded responses fixture file), email (captured to a slice), media (in-memory), users (test fixture), secrets (test fixture), audit (collected to a slice), cron (manually fire-able)h.LoadPlugin(path) errorinstantiates the WASM via wazero with the test hosth.ApplyFilter(name, value, args...),h.DoAction(name, args...): drives the hook bush.GetRoute(path),h.PostRoute(path, body): drives plugin REST routesh.FireCron(name): manually fires a declared cron jobh.SetSecret(plugin, key, val): pre-populates test secretsh.AssertAuditEmitted(event, matcher): assertion helper for audit eventsgonext plugin test [dir]CLI: runs the plugin authors tests (go test ./...for Go plugins,cargo testfor Rust,npm testfor TS), all using the same fake hostDependencies
#237/#239/#242 (SDKs),
pgmockintegrationComplexity
L