Documentation ¶
Overview ¶
Package test provides helper functions for tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Build = os.Getenv("GITHUB_ACTION") != ""
Build is true when running in GitHub Actions. When true, database tests are skipped because currently we don't run MySQL in GitHub Acitons, but other tests and the Go build still run.
var Headers = map[string]string{}
var MySQLPort = map[string]string{
"mysql57": "33570",
"mysql80": "33800",
"ps57": "33900",
}
var True = &t
Functions ¶
func MakeHTTPRequest ¶
MakeHTTPRequest is a helper function for making an http request. The response body of the http request is unmarshalled into the struct pointed to by the respStruct argument (if it's not nil). The status code of the response is returned.
func ReadPlan ¶
ReadPlan is nearly the same as plan.ReadFile but recreated in pkg test because it creates an import cycle like: metrics/foo imports test, which imports plan, which imports metrics/, which importas all the metrics include metrics/foo. It's more important for plan to import metrics, so it can do plan validation, so we work around the issue here instead.
Types ¶
This section is empty.