test

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package test provides helper functions for tests.

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
var Headers = map[string]string{}
View Source
var MySQLPort = map[string]string{

	"mysql57": "33570",
	"mysql80": "33800",
	"ps57":    "33900",
}
View Source
var True = &t

Functions

func Connection

func Connection(distroVersion string) (string, *sql.DB, error)

func MakeHTTPRequest

func MakeHTTPRequest(httpVerb, url string, payload []byte, respStruct interface{}) (int, error)

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

func ReadPlan(t *testing.T, file string) blip.Plan

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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