Documentation ¶
Index ¶
- func AssertFileContainsMatch(t *testing.T, zipFilename, fileInZip, regex string)
- func AssertRemoteFileDoesNotExist(t *testing.T, credentials sftp.SSHCredentials, directory, regex string)
- func AssertZipContainsFiles(t *testing.T, filename string, files []string)
- func DefaultContainerRequest(dockerContext, mysqlPass, mysqlDb string) testcontainers.ContainerRequest
- func InstallWP(t *testing.T, c *Container, siteUrl types.SiteUrl)
- func StartComposeContainers(t *testing.T, req ComposeRequest) map[string]*Container
- type ComposeRequest
- type ComposeService
- type Container
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertFileContainsMatch ¶
func AssertRemoteFileDoesNotExist ¶
func AssertRemoteFileDoesNotExist(t *testing.T, credentials sftp.SSHCredentials, directory, regex string)
func AssertZipContainsFiles ¶
func DefaultContainerRequest ¶
func DefaultContainerRequest(dockerContext, mysqlPass, mysqlDb string) testcontainers.ContainerRequest
Convenience function to create the most common container request.
func InstallWP ¶
InstallWP uses wp-cli to install wordpress in the running container. It is a helper function that most tests will need to use in order to get a working wordpress installation.
func StartComposeContainers ¶
func StartComposeContainers(t *testing.T, req ComposeRequest) map[string]*Container
StartComposeContainers uses testcontainers to start a containers from a compose file. It handles wrapping the containers in our own Container struct as well as cleaning up the containers when the test is finished. The individual containers are returned in a map keyed by their service name.
Types ¶
type ComposeRequest ¶
type ComposeRequest struct { PathToComposeFile string Services []ComposeService }
ComposeRequest contains the information needed to start a compose container.
func DefaultComposeRequest ¶
func DefaultComposeRequest(pathToComposeFile string) ComposeRequest
Convenience function to create the most common compose request.
type ComposeService ¶
ComposeService are the individual services in a compose container.
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
A Container is our wrapper around a testcontainers.Container
func StartContainer ¶
StartContainer uses testcontainers to start a container. It handles wrapping the container in our own Container struct as well as cleaning up the container when the test is finished.