Documentation
¶
Overview ¶
Package conformance provides a Plugin API conformance suite that third-party plugin authors can run against their plugin to prove it meets the host contract defined by the plugin package.
Usage:
result := conformance.Verify(myPlugin)
if !result.OK() {
for _, f := range result.Failures() {
fmt.Println(f.Name, ":", f.Detail)
}
}
Or, from a test:
func TestMyPluginConforms(t *testing.T) {
conformance.VerifyT(t, myPlugin)
}
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Check ¶
type Check struct {
// Name is a short, stable identifier for the assertion (e.g. "manifest/id").
Name string
// Passed reports whether the assertion succeeded.
Passed bool
// Detail carries a human-readable explanation; non-empty on failure, may
// also carry a success summary.
Detail string
}
Check holds the outcome of a single conformance assertion.
type Result ¶
type Result struct {
Checks []Check
}
Result aggregates the outcome of all conformance checks produced by Verify.
func Verify ¶
Verify runs parsePlugin through a real plugin.Host and returns the result of all conformance checks. The plugin is not required to be registered on any external host; Verify constructs its own isolated host for each phase.
Checks performed:
- Manifest validity — non-empty ID and Version, recognised Tier, well-formed Requires (no blank or unknown capabilities, no duplicates).
- Registration — registering onto a fresh Host succeeds without error, and if Setup returns a CleanupFunc, that func is non-nil.
- Contributions observable — whatever the plugin contributes (devtools sections, route guards, panels, etc.) is visible on the Host after registration.
- Teardown — calling Host.Close returns nil error; contributions are gone afterwards; calling Close a second time does not return an error.
- No panic — the full register→observe→teardown cycle does not panic.
Click to show internal directories.
Click to hide internal directories.