testutil

package
v0.8.15 Latest Latest
Warning

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

Go to latest
Published: May 20, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DebugFlagSet

func DebugFlagSet() bool

func JSON

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

func JSONDiffs

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

func PortOpen(listenAddress string) bool

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

func PrettyPrintObject

func PrettyPrintObject(obj interface{}) string

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

func VaultTokenRefresh

func VaultTokenRefresh()

func VaultValue

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

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

func NewLogDebugger

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

func (*LogDebugger) Contains

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

func (*LogDebugger) Write

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