test

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const SkipDefaultBlueprintURL = " "

SkipDefaultBlueprintURL is a sentinel for DefaultBlueprintURL that disables loading the default OCI blueprint (used in unit tests).

Variables

This section is empty.

Functions

This section is empty.

Types

type TestResult

type TestResult struct {
	Name       string
	Passed     bool
	Diffs      []string
	SourceFile string
}

TestResult represents the result of running a single test case.

type TestRunner

type TestRunner struct {
	DefaultBlueprintURL string
	RunFunc             func(filter string) ([]TestResult, error)
	// contains filtered or unexported fields
}

TestRunner discovers and executes blueprint composition tests.

func NewTestRunner

func NewTestRunner(rt *runtime.Runtime, artifactBuilder artifact.Artifact) *TestRunner

NewTestRunner creates a new TestRunner using the provided runtime and artifact builder. It stores base dependencies for creating isolated runtime instances for each test case, ensuring test isolation.

func (*TestRunner) Run

func (r *TestRunner) Run(filter string) ([]TestResult, error)

Run discovers and executes test cases, returning results for each test. If filter is provided, only tests matching the filter name are executed.

func (*TestRunner) RunAndPrint

func (r *TestRunner) RunAndPrint(filter string) error

RunAndPrint discovers and executes test cases, printing results to stdout. If filter is provided, only tests matching the filter name are executed. Returns an error if tests fail or execution encounters an error.

Jump to

Keyboard shortcuts

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