conformance

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package conformance runs reusable Runtime Protocol v1 behavior tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArgumentValues

func ArgumentValues() []string

ArgumentValues returns exact argv test values, including shell metacharacters.

func RequireRuntimeError

func RequireRuntimeError(
	t *testing.T,
	err error,
	category runtimev1.RuntimeErrorCode,
) *runtimev1.RuntimeError

RequireRuntimeError checks canonical status and typed runtime category, and returns the detail for additional retryability and diagnostic assertions. Use this for runtime-specific fault injection in addition to Run.

func Run

func Run(t *testing.T, options Options)

Run checks discovery, lifecycle, streaming, and context semantics through a real client. It never chooses a shell, image, executable, or process ownership policy.

Types

type Options

type Options struct {
	// Connect returns a fresh client per subtest. Register process/connection cleanup
	// with t.Cleanup; it must run after the suite's workspace cleanup.
	Connect func(t *testing.T) runtimev1.RuntimeDriverClient
	// Workspace returns creation intent for a unique, initially absent workspace.
	Workspace func(t *testing.T) *runtimev1.RunImageRequest
	// Command supplies exact argv and execution options for the requested scenario.
	Command func(scenario Scenario, workspaceID string) *runtimev1.ExecStart
	// LogData is the expected finite, merged binary log stream when Logs is advertised.
	LogData []byte
	// Timeout bounds each subtest's RPCs. Zero selects 30 seconds.
	Timeout time.Duration
}

Options adapts the suite to a runtime's launcher, image, and test commands.

type Scenario

type Scenario string

Scenario identifies a command with a defined observable behavior. See the SDK README for the command and output contract of each scenario.

const (
	Echo      Scenario = "echo"
	Arguments Scenario = "arguments"
	Shell     Scenario = "shell"
	Stderr    Scenario = "stderr"
	Duplex    Scenario = "duplex"
	Nonzero   Scenario = "nonzero"
	Signal    Scenario = "signal"
	EarlyExit Scenario = "early-exit"
	Block     Scenario = "block"
)

Command scenarios used by Run.

Directories

Path Synopsis
Package fake provides a persistent runtime fixture for real protocol tests.
Package fake provides a persistent runtime fixture for real protocol tests.

Jump to

Keyboard shortcuts

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