testutil

package
v0.0.0-...-71af207 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestTimeout         = 5 * time.Second
	RPCTestTimeout      = 30 * time.Second
	ProcessTestTimeout  = 15 * time.Second
	ManagerTestTimeout  = 5 * TestTimeout
	ExecutorTestTimeout = 5 * time.Second
	LongTestTimeout     = 100 * time.Second
)

Constants for test timeouts.

Variables

This section is empty.

Functions

func AddFileToDirectory

func AddFileToDirectory(dir, fileName, fileContents string) error

AddFileToDirectory adds an archive file given by fileName with the given fileContents to the directory.

func BuildDirectory

func BuildDirectory() string

BuildDirectory is the project-level directory where all build artifacts are put.

func GetPortNumber

func GetPortNumber() int

GetPortNumber returns a new port number that has not been used in the current runtime.

func GolangMainFail

func GolangMainFail() string

GolangMainFail returns the contents of a Golang main script that will fail when run.

func GolangMainSuccess

func GolangMainSuccess() string

GolangMainSuccess returns the contents of a Golang main script that will succeed when run.

func GolangTestFail

func GolangTestFail() string

GolangTestFail returns the contents of a Golang test that will fail when runk.

func GolangTestSuccess

func GolangTestSuccess() string

GolangTestSuccess returns the contents of a Golang test that will succeed when run.

func RemoveWhitespace

func RemoveWhitespace(str string) string

RemoveWhitespace returns the string without any whitespace characters.

func WaitForHTTPService

func WaitForHTTPService(ctx context.Context, url string, httpClient *http.Client) error

WaitForHTTPService waits until either the HTTP service becomes available to serve requests to the given URL or the context is done.

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