Documentation
¶
Index ¶
- Constants
- func BinaryInPath(bin string) error
- func DeleteFromResult(t testing.TB, pth string, r gjson.Result) gjson.Result
- func GetFirstMatchResult(t testing.TB, rs []gjson.Result, k, v string) gjson.Result
- func GetLoggerFromT() *logger.Logger
- func GetResultStrSlice(rs []gjson.Result) []string
- func LoadJSON(t testing.TB, path string) gjson.Result
- func ParseJSONResult(t testing.TB, j string) gjson.Result
- func Poll(t testing.TB, condition func() (bool, error), numRetries int, ...)
- func RandStr(l int) string
- func RunStage(stageName string, stage func())
- func SetEnv(t testing.TB, key string, value string)
- func ValFromEnv(t testing.TB, k string) string
- func WriteTmpFile(data string) (string, error)
Constants ¶
const RUN_STAGE_ENV_VAR = "RUN_STAGE"
Variables ¶
This section is empty.
Functions ¶
func BinaryInPath ¶
BinaryInPath checks if a given binary is in path.
func DeleteFromResult ¶
DeleteFromResult deletes given path from result and returns the modified result
func GetFirstMatchResult ¶
GetFirstMatchResult returns the first matching result with a given k/v
func GetLoggerFromT ¶
GetLoggerFromT returns a logger based on test verbosity
func GetResultStrSlice ¶
GetResultStrSlice parses results into a string slice
func LoadJSON ¶
LoadJSON reads and parses a json file into a gjson.Result. It fails test if not unable to parse.
func ParseJSONResult ¶
ParseJSONResult converts a JSON string into gjson result
func Poll ¶
Polls on a particular condition function while the returns true. It fails the test if the condition is not met within numRetries.
func RunStage ¶
func RunStage(stageName string, stage func())
RunStage runs stage if stageName matches RUN_STAGE env var or RUN_STAGE is unset. Similar to terratest RunStage but instead of skipping using env var, we match using envvar.
func ValFromEnv ¶
ValFromEnv returns value for a given env var. It fails test if not set.
func WriteTmpFile ¶
WriteTmpFile writes data to a temp file and returns the path.
Types ¶
This section is empty.