plugintest

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServeInBackground

func ServeInBackground(t *testing.T, config Config)

ServeInBackground serves the plugin in background with the provided configuration. The plugin will be unloaded when the test is over.

Types

type Config

type Config struct {
	// PluginServer is the plugin server implemented by the plugin.
	PluginServer pluginsdk.PluginServer

	// PluginClient is the plugin clients that the test needs have initialized
	// to facilitate testing the plugin implementations. This field is
	// optional.
	PluginClient pluginsdk.PluginClient

	// ServiceServers are the service servers implemented by the plugin. This
	// field is optional.
	ServiceServers []pluginsdk.ServiceServer

	// ServiceClients are the service clients that the test needs have
	// initialized to facilitate testing service implementations on the plugin.
	// This field is optional.
	ServiceClients []pluginsdk.ServiceClient

	// HostServiceServers are the host services that the test wants to offer to
	// the plugin. This field is optional.
	HostServiceServers []pluginsdk.ServiceServer

	// Logger is an optional logger for capturing log events from the plugin.
	// This field is optional.
	Logger hclog.Logger
}

Config is the test configuration for the plugin. It defines which plugin services, and host services are wired up.

Jump to

Keyboard shortcuts

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