Documentation
¶
Overview ¶
Package pluginkittest holds the checks every first-party plugin test shares.
Index ¶
- func CheckContract(t *testing.T, p pluginkit.Plugin, manifestPath string)
- func CheckDNSContract(t *testing.T, p pluginkit.Plugin, manifestPath string)
- func Event() *pluginpb.Event
- func NoSleep(context.Context, time.Duration) error
- func RunErrorCases(t *testing.T, send func(serverURL string) pluginkit.Result)
- func ServeDNS(t *testing.T, p pluginkit.Plugin) (pluginpb.DnsProviderServiceClient, pluginpb.PluginServiceClient)
- func Status(code int, body string) http.HandlerFunc
- type ErrorCase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckContract ¶
CheckContract validates the manifest on disk and drives Describe, Health and Send through a real gRPC server on a unix socket.
func CheckDNSContract ¶
CheckDNSContract validates the manifest on disk and drives Describe, Health and a credential-less ListZones through a real gRPC server.
func RunErrorCases ¶
RunErrorCases runs every ErrorCase against send, which must target the server URL it is given.
func ServeDNS ¶
func ServeDNS(t *testing.T, p pluginkit.Plugin) (pluginpb.DnsProviderServiceClient, pluginpb.PluginServiceClient)
ServeDNS runs p on a unix socket and returns a client for its DNS service and the connection for the plugin service.
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.