cli

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunCLI

func RunCLI(ctx context.Context, w io.Writer, ew io.Writer, args []string) error

RunCLI provides a testable interface for running the op-deployer CLI

Types

type CLITestRunner

type CLITestRunner struct {
	// contains filtered or unexported fields
}

CLITestRunner provides utilities for running op-deployer CLI commands in tests

func NewCLITestRunner

func NewCLITestRunner(t *testing.T) *CLITestRunner

NewCLITestRunner creates a new CLI test runner

func NewCLITestRunnerWithNetwork

func NewCLITestRunnerWithNetwork(t *testing.T) *CLITestRunner

NewCLITestRunnerWithNetwork creates a new CLI test runner with network setup

func (*CLITestRunner) ExpectErrorContains

func (r *CLITestRunner) ExpectErrorContains(t *testing.T, args []string, env map[string]string, contains string) string

ExpectErrorContains runs a command expecting it to fail with specific error text

func (*CLITestRunner) ExpectSuccess

func (r *CLITestRunner) ExpectSuccess(t *testing.T, args []string, env map[string]string) string

ExpectSuccess runs a command expecting it to succeed

func (*CLITestRunner) ExpectSuccessWithNetwork

func (r *CLITestRunner) ExpectSuccessWithNetwork(t *testing.T, args []string, env map[string]string) string

ExpectSuccessWithNetwork runs a command with network parameters expecting it to succeed

func (*CLITestRunner) GetWorkDir

func (r *CLITestRunner) GetWorkDir() string

GetWorkDir returns the working directory for this test runner

func (*CLITestRunner) Run

func (r *CLITestRunner) Run(ctx context.Context, args []string, env map[string]string) (string, error)

Run executes a CLI command and returns the output

func (*CLITestRunner) RunWithNetwork

func (r *CLITestRunner) RunWithNetwork(ctx context.Context, args []string, env map[string]string) (string, error)

RunWithNetwork executes a CLI command with network parameters if available

Jump to

Keyboard shortcuts

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