runner

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package runner provides functionality to execute and parse output from Go and Node.js test runs. It maps default test output into localized, visually structured terminal responses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandFn

type CommandFn func(cmd string, args ...string) Exec

CommandFn represents a function signature for instantiating an Exec implementation based on command arguments.

type Exec

type Exec interface {
	StdoutPipe() (io.ReadCloser, error)
	Start() error
	Wait() error
}

Exec defines the interface required to read output and handle process lifecycle for tests.

type Options added in v1.2.0

type Options struct {
	RerunFailed bool // run only tests that failed on the previous run
	ChangedOnly bool // run only packages touched according to git
}

Options configures incremental execution modes.

type Runner

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

Runner holds the configuration and internal state needed to execute tests and aggregate failure data.

func New

func New(lang langs.Lang, fn CommandFn) *Runner

New creates and returns a Runner instance pointing to the specified language environment and command function.

func (*Runner) AutoExecute added in v1.1.0

func (r *Runner) AutoExecute() int

AutoExecute detects the project framework, routes to the matching executor, and returns the process exit code. The caller is responsible for os.Exit.

func (*Runner) Execute

func (r *Runner) Execute() int

Execute initiates Go language tests using JSON stream output, processes the results, and returns the process exit code.

func (*Runner) ExecuteNode added in v1.1.0

func (r *Runner) ExecuteNode() int

ExecuteNode executes Node.js tests capturing data using the TAP reporter stream, formats the output, and returns the process exit code.

func (*Runner) SetOptions added in v1.2.0

func (r *Runner) SetOptions(o Options)

SetOptions configures the incremental execution modes for the runner.

type TestEvent

type TestEvent struct {
	Action  string  `json:"Action"`
	Package string  `json:"Package"`
	Test    string  `json:"Test"`
	Output  string  `json:"Output"`
	Elapsed float64 `json:"Elapsed"`
}

TestEvent represents the JSON structure of a single test output event generated by Go tools.

Jump to

Keyboard shortcuts

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