plugintest

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CaptureLogOutput

func CaptureLogOutput(t *testing.T, fn func()) string

func LoadJSONFile

func LoadJSONFile[T any](t *testing.T, dir, filename string) T

func LoadPluginReport

func LoadPluginReport(t *testing.T, serviceDir, pluginName string) ci.Report

func LoadReport

func LoadReport(t *testing.T, serviceDir, filename string) ci.Report

func MustRuntime

func MustRuntime[T any](t *testing.T, provider plugin.RuntimeProvider, appCtx *plugin.AppContext) T

func NewAppContext

func NewAppContext(t *testing.T, workDir string) *plugin.AppContext

func RunBlobStoreContractSuite added in v0.9.4

func RunBlobStoreContractSuite(t *testing.T, suite BlobStoreContractSuite)

RunBlobStoreContractSuite executes the shared blob-store backend contract checks.

Types

type BlobStoreContractSuite added in v0.9.4

type BlobStoreContractSuite struct {
	Factory      BlobStoreFactory
	Namespace    string
	AltNamespace string
	Key          string
	AltKey       string
	Payload      []byte
	StreamData   string
}

BlobStoreContractSuite configures the shared blob-store contract checks.

type BlobStoreFactory added in v0.9.4

type BlobStoreFactory func(tb testing.TB, backingID string) plugin.BlobStore

BlobStoreFactory creates a store instance bound to the provided backing id. Backends may interpret the backing id as a root directory, prefix, or another stable locator that allows creating another instance over the same storage.

type StubChangeDetector

type StubChangeDetector struct {
	StubPlugin
	ChangedModules   []*discovery.Module
	ChangedFiles     []string
	ChangedLibraries []string
	Err              error
}

StubChangeDetector implements ChangeDetectionProvider for testing.

func (*StubChangeDetector) DetectChangedLibraries

func (d *StubChangeDetector) DetectChangedLibraries(_ context.Context, _ *plugin.AppContext, _ string, _ []string) ([]string, error)

func (*StubChangeDetector) DetectChangedModules

func (d *StubChangeDetector) DetectChangedModules(_ context.Context, _ *plugin.AppContext, _ string, _ *discovery.ModuleIndex) ([]*discovery.Module, []string, error)

type StubConfig

type StubConfig struct {
	Enabled bool
}

StubConfig is a minimal config struct for testing.

type StubConfigPlugin

type StubConfigPlugin struct {
	plugin.BasePlugin[*StubConfig]
}

StubConfigPlugin embeds BasePlugin for testing config-aware scenarios.

type StubPlugin

type StubPlugin struct {
	NameVal string
	DescVal string
}

StubPlugin is a minimal Plugin implementation for testing.

func (*StubPlugin) Description

func (p *StubPlugin) Description() string

func (*StubPlugin) Name

func (p *StubPlugin) Name() string

Jump to

Keyboard shortcuts

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