cli

package
v1.16.7 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 21 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, opts ...CLITestRunnerOption) *CLITestRunner

func NewCLITestRunnerWithNetwork

func NewCLITestRunnerWithNetwork(t *testing.T, opts ...CLITestRunnerOption) *CLITestRunner

NewCLITestRunnerWithNetwork creates a new CLI test runner with default network setup. Defaults can be overridden using functional options.

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) ExpectErrorContainsWithNetwork added in v1.16.7

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

ExpectErrorContainsWithNetwork runs a command with network parameters 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) GetL1RPC added in v1.16.7

func (r *CLITestRunner) GetL1RPC() string

GetL1RPC returns the L1 RPC URL for this test runner

func (*CLITestRunner) GetPrivateKey added in v1.16.7

func (r *CLITestRunner) GetPrivateKey() string

GetPrivateKey returns the private key hex for this test runner

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

type CLITestRunnerOption added in v1.14.3

type CLITestRunnerOption func(*CLITestRunner)

CLITestRunnerOption is a functional option for configuring CLITestRunner

func WithL1RPC added in v1.14.3

func WithL1RPC(rpcURL string) CLITestRunnerOption

func WithPrivateKey added in v1.14.3

func WithPrivateKey(pkHex string) CLITestRunnerOption

Jump to

Keyboard shortcuts

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