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 DefaultMySQLVersion = "mysql80"
DefaultMySQLVersion is used in all tests, corresponds to a MySQLPort value. To make a specify test use a different MySQL version, set it explicitly in the test, like test.Connection("<specific version>"). Make sure it has a key in MySQLPort.
var Headers = map[string]string{}
var MySQLPort = map[string]string{
"mysql80": "33800",
"mysql57": "33570",
"ps57": "33900",
}
MySQLPort maps to Docker ports in docker/docker-compose.yaml.
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.