binary

package
v1.0.43185-pre Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package binary builds the circleci CLI binary once per test run and provides helpers for running it in tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(binaryName, relativeDir, source string) (string, func(), error)

func RunCLIInteractive

func RunCLIInteractive(t testing.TB, opts RunOpts) *expect.Console

RunCLIInteractive executes the circleci binary attached to a PTY and returns the console so callers can drive interactive input with Expect/Send. Call cmd.Wait() after interaction is complete.

Types

type CLIResult

type CLIResult struct {
	Stdout   string
	Stderr   string
	ExitCode int
}

CLIResult holds the output of a CLI invocation.

func RunCLI

func RunCLI(t *testing.T, opts RunOpts) CLIResult

RunCLI executes the circleci binary with the given args, env, and working directory.

type RunOpts

type RunOpts struct {
	Binary  string
	Args    []string
	Env     []string
	WorkDir string
	TTY     bool
	// Stdin, if non-nil, is connected to the CLI's stdin (non-TTY mode only).
	// TTY mode always uses the expect pty.
	Stdin io.Reader
}

Jump to

Keyboard shortcuts

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