test

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2021 License: Apache-2.0 Imports: 24 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.Version) *httptest.Server

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

func RequireFakeEnvoy

func RequireFakeEnvoy(t *testing.T, path string)

RequireFakeEnvoy writes fakeEnvoyBin to the given path

func RequireFakeEnvoyTarGz

func RequireFakeEnvoyTarGz(t *testing.T, v version.Version) ([]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) (err error)

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

func TarballURL

func TarballURL(baseURL, goos, goarch string, v version.Version) 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 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