Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var StdlibHTTPClient = http.DefaultClient
Functions ¶
func IncludeLicenseEnvVars ¶
func IncludeLicenseEnvVars(e *testscript.Env) error
func IsTCPPortBindable ¶
Tries an open port 3x times with short delays between each time to ensure the port is really free.
func TestscriptExtraFunctions ¶
func TestscriptExtraFunctions() map[string]func(*testscript.TestScript, bool, []string)
TestscriptExtraFunctions returns extra functions uitable for use with the testscript package, which might be useful for tests. The benefit of implementing such functionality in this way rather than using a shell script, or another scripting tool like babashka or python, is that we can ensure that the custom commands are available on all platforms without needing to set up any special PATH variables or install extra depenandices, which can be an issue in CI, especially for cross testing.
These additional functions are available:
httpwait <url> <expected value> [<retries>] [<interval>] [<backoff coefficient>]
httpwait will repeatedly request thie given URL until it receives a body response that equals the expected value. Both values are trimmed before comparison. If the check fails, it will be retried up to <retries> many times, waiting <interval> ms after each retry, with the <interval> being multiplied by the backoff coefficient during each iteration. defaults: retries=8 interval=128 backoff=2
Types ¶
This section is empty.