plugintest

package
v0.1.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package plugintest provides test helpers for exercising a plugin's Connect/Session against a real target, without depending on the core.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CredentialKindSupported added in v0.1.4

func CredentialKindSupported(schema plugin.Schema, kind plugin.CredentialKind) bool

CredentialKindSupported reports whether a schema has any credential_ref field that accepts kind.

func DirectTransport

func DirectTransport() plugin.NetTransport

DirectTransport returns a plugin.NetTransport that dials targets directly, for driving a plugin Connect/Session in tests. It has no egress allow-list, so a test may reach any address it sets up.

func HTTPTransport

func HTTPTransport(baseURL string, rt http.RoundTripper) plugin.NetTransport

HTTPTransport returns a plugin.NetTransport that offers an L7 client (base URL + RoundTripper), like the core's agent http_proxy mode, for testing a plugin's HTTP egress. DialContext (L4) is unavailable.

func Projection added in v0.1.4

func Projection(t testing.TB, p plugin.Plugin) plugin.Projection

Projection validates the plugin and returns its browser projection.

func RouteMap added in v0.1.4

func RouteMap(routes []plugin.Route) map[string]plugin.Route

RouteMap indexes routes by ID for projection tests.

func TransportFunc

func TransportFunc(dial func(ctx context.Context, network, addr string) (net.Conn, error)) plugin.NetTransport

TransportFunc returns a plugin.NetTransport whose DialContext delegates to dial — for exercising a plugin over a custom or agent-style transport in tests without standing up the core's tunnel registry.

func ValidatePlugin added in v0.1.4

func ValidatePlugin(t testing.TB, p plugin.Plugin)

ValidatePlugin validates the plugin manifest, route contract, UX contract, and projected panel config shapes.

func ValidatePluginUX added in v0.1.5

func ValidatePluginUX(t testing.TB, p plugin.Plugin)

ValidatePluginUX checks release-blocking generic renderer UX rules.

func ValidateProjectionPanelConfigs added in v0.1.5

func ValidateProjectionPanelConfigs(t testing.TB, proj plugin.Projection)

ValidateProjectionPanelConfigs checks every projected panel config against the SDK panel config schemas used by the browser renderer.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL