Documentation ¶
Overview ¶
Package testutil provides test helpers for the golang-samples repo.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
func ContextMain ¶
ContextMain gets a test context from a TestMain function. Useful for initializing global variables before running parallel system tests. ok is false if the project is not set up properly for system tests.
func EndToEndTest ¶
EndToEndTest gets the test context, and sets the test as Parallel. The test is skipped if the GOLANG_SAMPLES_E2E_TEST environment variable is not set.
func SystemTest ¶
SystemTest gets the test context. The test is skipped if the GOLANG_SAMPLES_PROJECT_ID environment variable is not set.
type R ¶
type R struct { // The number of current attempt. Attempt int // contains filtered or unexported fields }
R is passed to each run of a flaky test run, manages state and accumulates log statements.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner holds the result of `go build`
func BuildMain ¶
BuildMain builds the main package in the current working directory. If it doesn't build, t.Fatal is called. Test methods calling BuildMain should run Runner.Cleanup.