pluginkittest

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package pluginkittest holds the checks every first-party plugin test shares.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckContract

func CheckContract(t *testing.T, p pluginkit.Plugin, manifestPath string)

CheckContract validates the manifest on disk and drives Describe, Health and Send through a real gRPC server on a unix socket.

func CheckDNSContract

func CheckDNSContract(t *testing.T, p pluginkit.Plugin, manifestPath string)

CheckDNSContract validates the manifest on disk and drives Describe, Health and a credential-less ListZones through a real gRPC server.

func Event

func Event() *pluginpb.Event

Event is a representative firing alert.

func NoSleep

func NoSleep(context.Context, time.Duration) error

NoSleep makes retries instant in tests.

func RunErrorCases

func RunErrorCases(t *testing.T, send func(serverURL string) pluginkit.Result)

RunErrorCases runs every ErrorCase against send, which must target the server URL it is given.

func ServeDNS

ServeDNS runs p on a unix socket and returns a client for its DNS service and the connection for the plugin service.

func Status

func Status(code int, body string) http.HandlerFunc

Status returns a handler that always answers with code and body.

Types

type ErrorCase

type ErrorCase struct {
	Name      string
	Handler   http.HandlerFunc
	Retryable bool
	Contains  string
}

ErrorCase is one shared HTTP failure every plugin must map the same way.

func ErrorCases

func ErrorCases() []ErrorCase

ErrorCases lists 401, 429 with a long Retry-After and 5xx.

Jump to

Keyboard shortcuts

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