Documentation ¶
Index ¶
- func AssertBuildpacksHaveDescriptors(t *testing.T, bps []buildpack.Buildpack, ...)
- func AssertContains(t *testing.T, actual, expected string)
- func AssertContainsAllInOrder(t *testing.T, actual bytes.Buffer, expected ...string)
- func AssertContainsMatch(t *testing.T, actual, exp string)
- func AssertEq(t *testing.T, actual, expected interface{})
- func AssertError(t *testing.T, actual error, expected string)
- func AssertFalse(t *testing.T, actual interface{})
- func AssertFunctionName(t *testing.T, fn interface{}, expected string)
- func AssertGitHeadEq(t *testing.T, path1, path2 string)
- func AssertIncludeAllExpectedPatterns(t *testing.T, receivedArgs []string, expectedPatterns ...[]string)
- func AssertMatch(t *testing.T, actual string, expected string)
- func AssertNil(t *testing.T, actual interface{})
- func AssertNilE(t *testing.T, actual interface{})
- func AssertNotContains(t *testing.T, actual, expected string)
- func AssertNotContainsMatch(t *testing.T, actual, exp string)
- func AssertNotEq(t *testing.T, actual, expected interface{})
- func AssertNotNil(t *testing.T, actual interface{})
- func AssertOnTarEntry(t *testing.T, tarPath, entryPath string, assertFns ...TarEntryAssertion)
- func AssertSameInstance(t *testing.T, actual, expected interface{})
- func AssertSliceContains(t *testing.T, slice []string, expected ...string)
- func AssertSliceContainsInOrder(t *testing.T, slice []string, expected ...string)
- func AssertSliceContainsMatch(t *testing.T, slice []string, expected ...string)
- func AssertSliceContainsOnly(t *testing.T, slice []string, expected ...string)
- func AssertSliceNotContains(t *testing.T, slice []string, expected ...string)
- func AssertTarFileContents(t *testing.T, tarfile, path, expected string)
- func AssertTarHasFile(t *testing.T, tarFile, path string)
- func AssertTarball(t *testing.T, path string)
- func AssertTrue(t *testing.T, actual interface{})
- func AssertUnique(t *testing.T, items ...interface{})
- func CheckImageBuildResult(response dockertypes.ImageBuildResponse, err error) error
- func CopyFile(t *testing.T, src, dst string)
- func CopyFileE(src, dst string) error
- func CreateImage(t *testing.T, dockerCli client.CommonAPIClient, repoName, dockerFile string)
- func CreateImageFromDir(t *testing.T, dockerCli client.CommonAPIClient, repoName string, dir string)
- func CreateImageOnRemote(t *testing.T, dockerCli client.CommonAPIClient, ...) string
- func CreateRegistryFixture(t *testing.T, tmpDir, fixturePath string) string
- func CreateTAR(t *testing.T, srcDir, tarDir string, mode int64) string
- func CreateTGZ(t *testing.T, srcDir, tarDir string, mode int64) string
- func Digest(t *testing.T, repoName string) string
- func DockerHostname(t *testing.T) string
- func DockerRmi(dockerCli client.CommonAPIClient, repoNames ...string) error
- func Eventually(t *testing.T, test func() bool, every time.Duration, timeout time.Duration)
- func HTTPGetE(url string, headers map[string]string) (string, error)
- func ImageID(t *testing.T, repoName string) string
- func MockWriterAndOutput() (*color.Console, func() string)
- func PullImageWithAuth(dockerCli client.CommonAPIClient, ref, registryAuth string) error
- func PushImage(dockerCli client.CommonAPIClient, ref string, ...) error
- func RandString(n int) string
- func RecursiveCopy(t *testing.T, src, dst string)
- func RecursiveCopyE(src, dst string) error
- func RecursiveCopyNow(t *testing.T, src, dst string)
- func RegistryHost(host, port string) string
- func RequireDocker(t *testing.T)
- func Run(t *testing.T, cmd *exec.Cmd) string
- func RunContainer(ctx context.Context, dockerCli client.CommonAPIClient, id string, ...) error
- func RunE(cmd *exec.Cmd) (string, error)
- func SkipIf(t *testing.T, expression bool, reason string)
- func SkipUnless(t *testing.T, expression bool, reason string)
- func TopLayerDiffID(t *testing.T, repoName string) string
- type AssertionManager
- func (a AssertionManager) AssertTrimmedContains(actual, expected string)
- func (a AssertionManager) Contains(actual, expected string)
- func (a AssertionManager) ContainsAll(actual string, expected ...string)
- func (a AssertionManager) ContainsF(actual, expected string, formatArgs ...interface{})
- func (a AssertionManager) ContainsJSON(actualJSON, expectedJSON string)
- func (a AssertionManager) ContainsTOML(actualTOML, expectedTOML string)
- func (a AssertionManager) ContainsWithMessage(actual, expected, messageFormat string)
- func (a AssertionManager) ContainsYAML(actualYAML, expectedYAML string)
- func (a AssertionManager) Equal(actual, expected interface{})
- func (a AssertionManager) EqualJSON(actualJSON, expectedJSON string)
- func (a AssertionManager) EqualTOML(actualTOML, expectedTOML string)
- func (a AssertionManager) EqualYAML(actualYAML, expectedYAML string)
- func (a AssertionManager) Error(actual error)
- func (a AssertionManager) ErrorContains(actual error, expected string)
- func (a AssertionManager) ErrorWithMessage(actual error, message string)
- func (a AssertionManager) ErrorWithMessageF(actual error, format string, args ...interface{})
- func (a AssertionManager) Fails(actual interface{})
- func (a *AssertionManager) FileExists(filePath string)
- func (a *AssertionManager) FileIsNotEmpty(filePath string)
- func (a AssertionManager) Matches(actual string, pattern *regexp.Regexp)
- func (a AssertionManager) MatchesAll(actual string, patterns ...*regexp.Regexp)
- func (a AssertionManager) Nil(actual interface{})
- func (a AssertionManager) NilWithMessage(actual interface{}, message string)
- func (a AssertionManager) NoMatches(actual string, pattern *regexp.Regexp)
- func (a AssertionManager) NotContainWithMessage(actual, expected, messageFormat string)
- func (a AssertionManager) NotContains(actual, expected string)
- func (a AssertionManager) NotEqual(actual, expected interface{})
- func (a AssertionManager) NotNil(actual interface{})
- func (a AssertionManager) Succeeds(actual interface{})
- func (a AssertionManager) TrimmedEq(actual, expected string)
- func (a AssertionManager) TrueWithMessage(actual bool, message string)
- type TarEntryAssertion
- func AssertOnNestedTar(nestedEntryPath string, assertions ...TarEntryAssertion) TarEntryAssertion
- func ContentContains(expected string) TarEntryAssertion
- func ContentEquals(expected string) TarEntryAssertion
- func DoesNotHaveModTime(expectedTime time.Time) TarEntryAssertion
- func HasFileMode(expectedMode int64) TarEntryAssertion
- func HasModTime(expectedTime time.Time) TarEntryAssertion
- func HasOwnerAndGroup(expectedUID int, expectedGID int) TarEntryAssertion
- func IsDirectory() TarEntryAssertion
- func IsGzipped() TarEntryAssertion
- func IsJSON() TarEntryAssertion
- func SymlinksTo(expectedTarget string) TarEntryAssertion
- type TarVerifier
- type TestRegistryConfig
- func (rc *TestRegistryConfig) AuthConfig() dockertypes.AuthConfig
- func (rc *TestRegistryConfig) Login(t *testing.T, username string, password string)
- func (rc *TestRegistryConfig) RegistryAuth() string
- func (rc *TestRegistryConfig) RegistryCatalog() (string, error)
- func (rc *TestRegistryConfig) RepoName(name string) string
- func (rc *TestRegistryConfig) RmRegistry(t *testing.T)
- func (rc *TestRegistryConfig) StopRegistry(t *testing.T)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertBuildpacksHaveDescriptors ¶ added in v0.12.0
func AssertContains ¶
func AssertContainsAllInOrder ¶ added in v0.12.0
func AssertContainsMatch ¶
AssertContainsMatch matches on content by regular expression
func AssertFalse ¶
func AssertFunctionName ¶ added in v0.12.0
func AssertGitHeadEq ¶ added in v0.12.0
func AssertIncludeAllExpectedPatterns ¶ added in v0.10.0
func AssertNil ¶
AssertNil checks for nil value, if not nil it fails the test and stops execution immediately.
func AssertNilE ¶ added in v0.19.0
AssertNilE checks for nil value, if not nil it sets test as failed without stopping execution.
func AssertNotContains ¶
func AssertNotContainsMatch ¶
func AssertNotEq ¶ added in v0.12.0
Assert deep equality (and provide useful difference as a test failure)
func AssertNotNil ¶
func AssertOnTarEntry ¶
func AssertOnTarEntry(t *testing.T, tarPath, entryPath string, assertFns ...TarEntryAssertion)
func AssertSameInstance ¶
Assert the simplistic pointer (or literal value) equality
func AssertSliceContains ¶
func AssertSliceContainsInOrder ¶ added in v0.12.0
func AssertSliceContainsMatch ¶ added in v0.10.0
func AssertSliceContainsOnly ¶
func AssertSliceNotContains ¶ added in v0.11.0
func AssertTarFileContents ¶ added in v0.12.0
func AssertTarHasFile ¶ added in v0.12.0
func AssertTarball ¶ added in v0.10.0
func AssertTrue ¶
func AssertUnique ¶
func CheckImageBuildResult ¶ added in v0.23.0
func CheckImageBuildResult(response dockertypes.ImageBuildResponse, err error) error
func CreateImage ¶
func CreateImage(t *testing.T, dockerCli client.CommonAPIClient, repoName, dockerFile string)
func CreateImageFromDir ¶
func CreateImageOnRemote ¶
func CreateImageOnRemote(t *testing.T, dockerCli client.CommonAPIClient, registryConfig *TestRegistryConfig, repoName, dockerFile string) string
func CreateRegistryFixture ¶ added in v0.12.0
func DockerHostname ¶ added in v0.13.0
func Eventually ¶
func MockWriterAndOutput ¶ added in v0.12.0
func PullImageWithAuth ¶
func PullImageWithAuth(dockerCli client.CommonAPIClient, ref, registryAuth string) error
func PushImage ¶
func PushImage(dockerCli client.CommonAPIClient, ref string, registryConfig *TestRegistryConfig) error
func RandString ¶
func RecursiveCopy ¶
func RecursiveCopyE ¶ added in v0.14.0
func RecursiveCopyNow ¶ added in v0.11.0
func RegistryHost ¶ added in v0.13.0
func RequireDocker ¶
func RunContainer ¶
Types ¶
type AssertionManager ¶ added in v0.13.0
type AssertionManager struct {
// contains filtered or unexported fields
}
func NewAssertionManager ¶ added in v0.13.0
func NewAssertionManager(testObject *testing.T) AssertionManager
func (AssertionManager) AssertTrimmedContains ¶ added in v0.13.0
func (a AssertionManager) AssertTrimmedContains(actual, expected string)
func (AssertionManager) Contains ¶ added in v0.13.0
func (a AssertionManager) Contains(actual, expected string)
func (AssertionManager) ContainsAll ¶ added in v0.13.0
func (a AssertionManager) ContainsAll(actual string, expected ...string)
func (AssertionManager) ContainsF ¶ added in v0.13.0
func (a AssertionManager) ContainsF(actual, expected string, formatArgs ...interface{})
func (AssertionManager) ContainsJSON ¶ added in v0.15.0
func (a AssertionManager) ContainsJSON(actualJSON, expectedJSON string)
func (AssertionManager) ContainsTOML ¶ added in v0.15.0
func (a AssertionManager) ContainsTOML(actualTOML, expectedTOML string)
func (AssertionManager) ContainsWithMessage ¶ added in v0.13.0
func (a AssertionManager) ContainsWithMessage(actual, expected, messageFormat string)
ContainsWithMessage will fail if expected is not contained within actual, messageFormat will be printed as the failure message, with actual interpolated in the message
func (AssertionManager) ContainsYAML ¶ added in v0.15.0
func (a AssertionManager) ContainsYAML(actualYAML, expectedYAML string)
func (AssertionManager) Equal ¶ added in v0.13.0
func (a AssertionManager) Equal(actual, expected interface{})
func (AssertionManager) EqualJSON ¶ added in v0.16.0
func (a AssertionManager) EqualJSON(actualJSON, expectedJSON string)
func (AssertionManager) EqualTOML ¶ added in v0.16.0
func (a AssertionManager) EqualTOML(actualTOML, expectedTOML string)
func (AssertionManager) EqualYAML ¶ added in v0.16.0
func (a AssertionManager) EqualYAML(actualYAML, expectedYAML string)
func (AssertionManager) Error ¶ added in v0.13.0
func (a AssertionManager) Error(actual error)
Error checks that the provided value is an error (non-nil)
func (AssertionManager) ErrorContains ¶ added in v0.14.0
func (a AssertionManager) ErrorContains(actual error, expected string)
func (AssertionManager) ErrorWithMessage ¶ added in v0.15.0
func (a AssertionManager) ErrorWithMessage(actual error, message string)
func (AssertionManager) ErrorWithMessageF ¶ added in v0.15.0
func (a AssertionManager) ErrorWithMessageF(actual error, format string, args ...interface{})
func (AssertionManager) Fails ¶ added in v0.14.0
func (a AssertionManager) Fails(actual interface{})
func (*AssertionManager) FileExists ¶ added in v0.16.0
func (a *AssertionManager) FileExists(filePath string)
func (*AssertionManager) FileIsNotEmpty ¶ added in v0.16.0
func (a *AssertionManager) FileIsNotEmpty(filePath string)
func (AssertionManager) Matches ¶ added in v0.13.0
func (a AssertionManager) Matches(actual string, pattern *regexp.Regexp)
func (AssertionManager) MatchesAll ¶ added in v0.13.0
func (a AssertionManager) MatchesAll(actual string, patterns ...*regexp.Regexp)
func (AssertionManager) Nil ¶ added in v0.13.0
func (a AssertionManager) Nil(actual interface{})
func (AssertionManager) NilWithMessage ¶ added in v0.13.0
func (a AssertionManager) NilWithMessage(actual interface{}, message string)
func (AssertionManager) NoMatches ¶ added in v0.13.0
func (a AssertionManager) NoMatches(actual string, pattern *regexp.Regexp)
func (AssertionManager) NotContainWithMessage ¶ added in v0.13.0
func (a AssertionManager) NotContainWithMessage(actual, expected, messageFormat string)
NotContainWithMessage will fail if expected is contained within actual, messageFormat will be printed as the failure message, with actual interpolated in the message
func (AssertionManager) NotContains ¶ added in v0.14.0
func (a AssertionManager) NotContains(actual, expected string)
func (AssertionManager) NotEqual ¶ added in v0.14.0
func (a AssertionManager) NotEqual(actual, expected interface{})
func (AssertionManager) NotNil ¶ added in v0.13.0
func (a AssertionManager) NotNil(actual interface{})
func (AssertionManager) Succeeds ¶ added in v0.14.0
func (a AssertionManager) Succeeds(actual interface{})
func (AssertionManager) TrimmedEq ¶ added in v0.13.0
func (a AssertionManager) TrimmedEq(actual, expected string)
func (AssertionManager) TrueWithMessage ¶ added in v0.15.0
func (a AssertionManager) TrueWithMessage(actual bool, message string)
type TarEntryAssertion ¶
func AssertOnNestedTar ¶ added in v0.10.0
func AssertOnNestedTar(nestedEntryPath string, assertions ...TarEntryAssertion) TarEntryAssertion
func ContentContains ¶ added in v0.10.0
func ContentContains(expected string) TarEntryAssertion
func ContentEquals ¶
func ContentEquals(expected string) TarEntryAssertion
func DoesNotHaveModTime ¶ added in v0.9.0
func DoesNotHaveModTime(expectedTime time.Time) TarEntryAssertion
func HasFileMode ¶
func HasFileMode(expectedMode int64) TarEntryAssertion
func HasModTime ¶
func HasModTime(expectedTime time.Time) TarEntryAssertion
func HasOwnerAndGroup ¶
func HasOwnerAndGroup(expectedUID int, expectedGID int) TarEntryAssertion
func IsDirectory ¶
func IsDirectory() TarEntryAssertion
func IsGzipped ¶ added in v0.10.0
func IsGzipped() TarEntryAssertion
func IsJSON ¶ added in v0.10.0
func IsJSON() TarEntryAssertion
func SymlinksTo ¶
func SymlinksTo(expectedTarget string) TarEntryAssertion
type TarVerifier ¶ added in v0.12.0
type TarVerifier struct {
// contains filtered or unexported fields
}
func NewTarVerifier ¶ added in v0.12.0
func (*TarVerifier) NextDirectory ¶ added in v0.12.0
func (v *TarVerifier) NextDirectory(name string, mode int64)
func (*TarVerifier) NextFile ¶ added in v0.12.0
func (v *TarVerifier) NextFile(name, expectedFileContents string, expectedFileMode int64)
func (*TarVerifier) NextSymLink ¶ added in v0.12.0
func (v *TarVerifier) NextSymLink(name, link string)
func (*TarVerifier) NoMoreFilesExist ¶ added in v0.12.0
func (v *TarVerifier) NoMoreFilesExist()
type TestRegistryConfig ¶
type TestRegistryConfig struct { RunRegistryHost string RunRegistryPort string DockerConfigDir string // contains filtered or unexported fields }
func RunRegistry ¶
func RunRegistry(t *testing.T) *TestRegistryConfig
func (*TestRegistryConfig) AuthConfig ¶
func (rc *TestRegistryConfig) AuthConfig() dockertypes.AuthConfig
func (*TestRegistryConfig) Login ¶
func (rc *TestRegistryConfig) Login(t *testing.T, username string, password string)
func (*TestRegistryConfig) RegistryAuth ¶
func (rc *TestRegistryConfig) RegistryAuth() string
func (*TestRegistryConfig) RegistryCatalog ¶
func (rc *TestRegistryConfig) RegistryCatalog() (string, error)
func (*TestRegistryConfig) RepoName ¶
func (rc *TestRegistryConfig) RepoName(name string) string
func (*TestRegistryConfig) RmRegistry ¶ added in v0.18.0
func (rc *TestRegistryConfig) RmRegistry(t *testing.T)
func (*TestRegistryConfig) StopRegistry ¶
func (rc *TestRegistryConfig) StopRegistry(t *testing.T)