crossrunner

package
v3.13.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Default timeout in seconds for client/server configurations without a defined timeout
	DefaultTimeout     = 7
	TestFailure        = 101
	CrossrunnerFailure = 102
)

Variables

This section is empty.

Functions

func AppendToFailures

func AppendToFailures(failLog string, pair *Pair) (err error)

Append to failures adds a the client and server logs from a failed configuration to the unexpected_failure.log file.

func GetTimestamp

func GetTimestamp() string

GetTimestamp returns the current time.

func Load

func Load(jsonFile string) ([]*Pair, []*Pair, error)

Load takes a json file of client/server definitions and returns a list of valid client/server pairs.

func PrintConsoleFooter

func PrintConsoleFooter(failed int, total uint64, runtime time.Duration)

PrintConsoleFooter writes the metadata associated with the test suite to the console.

func PrintConsoleHeader

func PrintConsoleHeader()

PrintConsoleHeader prints a header for all test configuration results to the console.

func PrintPairResult

func PrintPairResult(pair *Pair)

PrintPairResult prints a formatted pair result to the console.

func Run

func Run(testDefinitions, outDir *string, getCommand func(config Config, port int) (cmd *exec.Cmd, formatted string)) error

func RunConfig

func RunConfig(pair *Pair, port int, getCommand func(config Config, port int) (cmd *exec.Cmd, formatted string))

RunConfig runs a client against a server. Client/Server logs are created and failures are added to the unexpected_failures.log. Each result is logged to the console.

func WriteCustomData

func WriteCustomData(file string, info string) error

WriteCustomData writes any string to a file.

Types

type Config

type Config struct {
	Name      string
	Timeout   time.Duration
	Transport string
	Protocol  string
	Command   []string
	Workdir   string
	Logs      *os.File
}

Complete information required to shell out a client or server command.

type Pair

type Pair struct {
	Client     Config
	Server     Config
	ReturnCode int
	Err        error
}

Matched client and server commands.

Jump to

Keyboard shortcuts

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