test

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FakeReleaseDate helps us make sure main code doesn't accidentally write the system time instead of the expected.
	FakeReleaseDate = version.ReleaseDate("2020-12-31")
)

Variables

This section is empty.

Functions

func RequireEnvoyVersionsTestServer

func RequireEnvoyVersionsTestServer(t *testing.T, v version.PatchVersion) *httptest.Server

RequireEnvoyVersionsTestServer serves "/envoy-versions.json", containing download links a fake Envoy archive.

func RequireFakeEnvoyTarGz

func RequireFakeEnvoyTarGz(t *testing.T, v version.PatchVersion) ([]byte, version.SHA256Sum)

RequireFakeEnvoyTarGz makes a fake envoy.tar.gz

func RequireRun

func RequireRun(t *testing.T, shutdown func(), r Runner, stderr io.Reader, args ...string) error

RequireRun executes Run on the given Runtime and calls shutdown after it started.

func TarballURL

func TarballURL(baseURL, goos, goarch string, v version.PatchVersion) version.TarballURL

TarballURL gives the expected download URL for the given runtime.GOOS and Envoy version.

Types

type Runner

type Runner interface {
	Run(ctx context.Context, args []string) error
}

Runner allows us to not introduce dependency cycles on envoy.Runtime

Directories

Path Synopsis
Package fakebinary as using morerequire introduces build cycles
Package fakebinary as using morerequire introduces build cycles
Package morerequire includes more require functions than "github.com/stretchr/testify/require" Do not add dependencies on any main code as it will cause cycles.
Package morerequire includes more require functions than "github.com/stretchr/testify/require" Do not add dependencies on any main code as it will cause cycles.

Jump to

Keyboard shortcuts

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