invoketest

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package invoketest provides a contract test suite for invoke providers.

Index

Constants

View Source
const (
	CategoryCore        = "core"
	CategoryLifecycle   = "lifecycle"
	CategoryEnvironment = "environment"
	CategoryFilesystem  = "filesystem"
	CategorySystem      = "system"
	CategoryErrors      = "errors"
)

Standard categories for grouping tests.

Variables

This section is empty.

Functions

func Verify

func Verify(t *testing.T, env invoke.Environment)

Verify is the standard Go test entry point for provider authors.

Types

type T

type T interface {
	Errorf(format string, args ...any)
	FailNow()
	Skipf(format string, args ...any)
	Context() context.Context
	TempDir() string
	Name() string
}

T is the minimal interface required for testify/assert and require.

type TestCase

type TestCase struct {
	Category    string
	Name        string
	Description string
	Prereq      func(t T, env invoke.Environment) (ok bool, reason string)
	Run         func(t T, env invoke.Environment)
}

TestCase defines a single behavioral contract requirement.

func AllContracts

func AllContracts() []TestCase

AllContracts returns all test cases for the contract test suite.

func (TestCase) ID

func (tc TestCase) ID() string

ID returns the stable, globally unique contract identifier.

Jump to

Keyboard shortcuts

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