test

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MPL-2.0 Imports: 22 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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