testutil

package
v0.8.9 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DebugFlagSet added in v0.0.2

func DebugFlagSet() bool

func JSON added in v0.0.2

func JSON(t *testing.T, value interface{}) string

func JSONDiffs added in v0.0.2

func JSONDiffs(t *testing.T, expected, actual string) []string

func LogReadLine

func LogReadLine(reader *bufio.Reader, timeout time.Duration) (string, error)

LogReadLine reads and returns a single line from the given file. If a given timeout has passed, an error is returned.

func PortOpen added in v0.0.2

func PortOpen(listenAddress string) bool

PortOpen returns true if there's a socket listening on the specified listenAddress

func PrettyPrintObject added in v0.0.2

func PrettyPrintObject(obj interface{}) string

PrettyPrintObject returns the JSON representation of any object; only useful for debugging

func VaultTokenRefresh added in v0.0.2

func VaultTokenRefresh()

func VaultValue added in v0.0.2

func VaultValue(params ...interface{}) string

VaultValue returns a value from the vault service If query has 1 element, the secret is assumed to be named "integration-testing". Otherwise, there should be 2 elements, the first a secret, and the second a query passed to gjson, to get a value from the json object returned from Vault. The first parameter can also be a testing.T. In this case, the function won't panic, but use t.Fail.

Types

type LogDebugger added in v0.0.2

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

func NewLogDebugger added in v0.0.2

func NewLogDebugger(t *testing.T, logName string) *LogDebugger

func (*LogDebugger) Contains added in v0.0.2

func (d *LogDebugger) Contains(message string) bool

func (*LogDebugger) Write added in v0.0.2

func (d *LogDebugger) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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