testlib

package
v1.25.1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package testlib contains test helpers for goreleaser tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertSkipped added in v0.30.0

func AssertSkipped(t *testing.T, err error)

AssertSkipped asserts that a pipe was skipped.

func CatFileFromBareRepository added in v1.18.0

func CatFileFromBareRepository(tb testing.TB, url, name string) []byte

func CatFileFromBareRepositoryOnBranch added in v1.21.1

func CatFileFromBareRepositoryOnBranch(tb testing.TB, url, branch, name string) []byte

func CheckPath added in v0.183.0

func CheckPath(tb testing.TB, cmd string)

CheckPath skips the test if the binary is not in the PATH.

func GetFileFromArchive added in v1.17.0

func GetFileFromArchive(tb testing.TB, path, format, filename string) []byte

GetFileFromArchive returns the contents of filename inside the given archive path.

func GitAdd

func GitAdd(tb testing.TB)

GitAdd adds all files to stage.

func GitAnnotatedTag added in v1.2.0

func GitAnnotatedTag(tb testing.TB, tag, message string)

GitAnnotatedTag creates an annotated tag.

func GitBranch added in v0.142.0

func GitBranch(tb testing.TB, branch string)

GitBranch creates a git branch.

func GitCheckoutBranch added in v0.89.0

func GitCheckoutBranch(tb testing.TB, name string)

GitCheckoutBranch allows us to change the active branch that we're using.

func GitCommit

func GitCommit(tb testing.TB, msg string)

GitCommit creates a git commits.

func GitInit

func GitInit(tb testing.TB)

GitInit inits a new git project.

func GitMakeBareRepository added in v1.18.0

func GitMakeBareRepository(tb testing.TB) string

func GitRemoteAdd

func GitRemoteAdd(tb testing.TB, url string)

GitRemoteAdd adds the given url as remote.

func GitRemoteAddWithName added in v0.180.0

func GitRemoteAddWithName(tb testing.TB, remote, url string)

GitRemoteAddWithName adds the given url as remote with given name.

func GitTag

func GitTag(tb testing.TB, tag string)

GitTag creates a git tag.

func LsArchive added in v1.17.0

func LsArchive(tb testing.TB, path, format string) []string

LsArchive return the file list of a given archive in a given formatkj

func MakeNewSSHKey added in v1.18.0

func MakeNewSSHKey(tb testing.TB, pass string) string

func MakeNewSSHKeyType added in v1.22.0

func MakeNewSSHKeyType(tb testing.TB, pass string, algo keygen.KeyType) string

func Mktmp

func Mktmp(tb testing.TB) string

Mktmp creates a new tempdir, cd into it and provides a back function that cd into the previous directory.

func MustDockerPool added in v1.14.0

func MustDockerPool(f Fataler) *dockertest.Pool

MustDockerPool gets a single dockertet.Pool.

func MustKillContainer added in v1.14.0

func MustKillContainer(f Fataler, name string)

MustKillContainer kills the given container by name if it exists in the current dockertest.Pool.

func RequireTemplateError added in v1.11.0

func RequireTemplateError(tb testing.TB, err error)

RequireTemplateError requires thqt an error happens and that it is a template error.

func StartRegistry added in v1.15.0

func StartRegistry(tb testing.TB, name, port string)

StartRegistry starts a registry with the given name in the given port, and sets up its deletion on test.Cleanup.

Types

type Fataler added in v1.14.0

type Fataler interface {
	Fatal(args ...any)
}

Fataler interface, can be a log.Default() or testing.TB, for example.

Jump to

Keyboard shortcuts

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