drivertest

package
v0.0.0-...-915478c Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package drivertest provides a conformance test for implementations of runtimevar.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunConformanceTests

func RunConformanceTests(t *testing.T, newHarness HarnessMaker)

RunConformanceTests runs conformance tests for provider implementations of runtimevar.

Types

type Harness

type Harness interface {
	// MakeVar creates a *runtimevar.Variable to watch the given variable.
	MakeVar(ctx context.Context, name string, decoder *runtimevar.Decoder) (*runtimevar.Variable, error)
	// CreateVariable creates the variable with the given contents in the provider.
	CreateVariable(ctx context.Context, name string, val []byte) error
	// UpdateVariable updates an existing variable to have the given contents in the provider.
	UpdateVariable(ctx context.Context, name string, val []byte) error
	// DeleteVariable deletes an existing variable in the provider.
	DeleteVariable(ctx context.Context, name string) error
	// Close is called when the test is complete.
	Close()
}

Harness descibes the functionality test harnesses must provide to run conformance tests.

type HarnessMaker

type HarnessMaker func(t *testing.T) (Harness, error)

HarnessMaker describes functions that construct a harness for running tests. It is called exactly once per test; Harness.Close() will be called when the test is complete.

type Message

type Message struct {
	Name, Text string
}

Message is used as a target for JSON decoding.

Jump to

Keyboard shortcuts

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