testenv

package
v0.0.0-...-b94449b Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package testenv contains testing helpers for creating test harnesses and other common tasks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DockerAvailable

func DockerAvailable() error

func FakeExecPlanCompiler

func FakeExecPlanCompiler() func(context.Context, string, ...string) *exec.Cmd

func FakePlanCompiler

func FakePlanCompiler()

FakePlanCompiler is a fake implementation of polyester that can be used in unit tests by calling in a test function to allow for compilation of shell plans by writing a script that calls the test into $PATH.

func GitBare

func GitBare(t testing.TB, p string)

func GitClone

func GitClone(t testing.TB, cloneURL, p string)

func GitCommitAllPush

func GitCommitAllPush(t testing.TB, repoPath, message string)

func Mkdirs

func Mkdirs(t testing.TB, mode fs.FileMode, dirs ...string)

func Path

func Path(paths ...string) string

func ReadFile

func ReadFile(t testing.TB, p string) string

func RemoveOnSuccess

func RemoveOnSuccess(t testing.TB, tmpdir string)

func RequireEnv

func RequireEnv(t testing.TB, envs ...string)

func TempDir

func TempDir(t testing.TB, pat string) string

func TempPlanDir

func TempPlanDir(t testing.TB, fixtureDir string) string

func WriteFile

func WriteFile(t testing.TB, p, body string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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