testhelper

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 24, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package testhelper has convenience functions for tests, like returning pointers to values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IndentedJSON

func IndentedJSON(data interface{}) string

IndentedJSON returns data structure pretty printed as JSON

func NewTestLogger

func NewTestLogger() (obs *observer.ObservedLogs, log *zap.SugaredLogger)

NewTestLogger returns a ZAP logger for assertions, which also logs to /tmp/cf-operator-tests.log

func NewTestLoggerWithPath added in v0.2.2

func NewTestLoggerWithPath(path string) (obs *observer.ObservedLogs, log *zap.SugaredLogger)

NewTestLoggerWithPath returns a logger which logs to path

func RandString

func RandString(n int) string

RandString generates a random string of length n

func WaitForPort

func WaitForPort(host, port string, timeOut time.Duration) error

WaitForPort tests and waits on the availability of a TCP host and port

Types

This section is empty.

Source Files

  • logger.go
  • randomstring.go
  • test_helper.go
  • wait_for_port.go

Jump to

Keyboard shortcuts

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