package e2e
import "github.com/docker/compose/v2/pkg/e2e"
Index ¶
- Variables
- func CopyFile(sourceFile string, destinationFile string) error
- func HTTPGetWithRetry(t *testing.T, endpoint string, expectedStatus int, retryDelay time.Duration, timeout time.Duration) string
- func Lines(output string) []string
- func StdoutContains(expected string) func(*icmd.Result) bool
- type E2eCLI
- func NewParallelE2eCLI(t *testing.T, binDir string) *E2eCLI
- func (c *E2eCLI) MetricsSocket() string
- func (c *E2eCLI) NewCmd(command string, args ...string) icmd.Cmd
- func (c *E2eCLI) NewDockerCmd(args ...string) icmd.Cmd
- func (c *E2eCLI) RunCmd(args ...string) *icmd.Result
- func (c *E2eCLI) RunDockerCmd(args ...string) *icmd.Result
- func (c *E2eCLI) RunDockerComposeCmd(args ...string) *icmd.Result
- func (c *E2eCLI) RunDockerOrExitError(args ...string) *icmd.Result
- func (c *E2eCLI) WaitForCmdResult(command icmd.Cmd, predicate func(*icmd.Result) bool, timeout time.Duration, delay time.Duration)
- func (c *E2eCLI) WaitForCondition(predicate func() (bool, string), timeout time.Duration, delay time.Duration)
Variables ¶
var ( // DockerExecutableName is the OS dependent Docker CLI binary name DockerExecutableName = "docker" // DockerComposeExecutableName is the OS dependent Docker CLI binary name DockerComposeExecutableName = "docker-" + compose.PluginName // DockerScanExecutableName is the OS dependent Docker CLI binary name DockerScanExecutableName = "docker-scan" )
Functions ¶
func CopyFile ¶
CopyFile copies a file from a sourceFile to a destinationFile setting permissions to 0755
func HTTPGetWithRetry ¶
func HTTPGetWithRetry(t *testing.T, endpoint string, expectedStatus int, retryDelay time.Duration, timeout time.Duration) string
HTTPGetWithRetry performs an HTTP GET on an `endpoint`, using retryDelay also as a request timeout. In the case of an error or the response status is not the expeted one, it retries the same request, returning the response body as a string (empty if we could not reach it)
func Lines ¶
Lines split output into lines
func StdoutContains ¶
StdoutContains returns a predicate on command result expecting a string in stdout
Types ¶
type E2eCLI ¶
E2eCLI is used to wrap the CLI for end to end testing nolint stutter
func NewParallelE2eCLI ¶
NewParallelE2eCLI returns a configured TestE2eCLI with t.Parallel() set
func (*E2eCLI) MetricsSocket ¶
MetricsSocket get the path where test metrics will be sent
func (*E2eCLI) NewCmd ¶
NewCmd creates a cmd object configured with the test environment set
func (*E2eCLI) NewDockerCmd ¶
NewDockerCmd creates a docker cmd without running it
func (*E2eCLI) RunCmd ¶
RunCmd runs a command, expects no error and returns a result
func (*E2eCLI) RunDockerCmd ¶
RunDockerCmd runs a docker command, expects no error and returns a result
func (*E2eCLI) RunDockerComposeCmd ¶
RunDockerComposeCmd runs a docker compose command, expects no error and returns a result
func (*E2eCLI) RunDockerOrExitError ¶
RunDockerOrExitError runs a docker command and returns a result
func (*E2eCLI) WaitForCmdResult ¶
func (c *E2eCLI) WaitForCmdResult(command icmd.Cmd, predicate func(*icmd.Result) bool, timeout time.Duration, delay time.Duration)
WaitForCmdResult try to execute a cmd until resulting output matches given predicate
func (*E2eCLI) WaitForCondition ¶
func (c *E2eCLI) WaitForCondition(predicate func() (bool, string), timeout time.Duration, delay time.Duration)
WaitForCondition wait for predicate to execute to true
Source Files ¶
e2e_config_plugin.go framework.go
- Version
- v2.3.2
- Published
- Mar 8, 2022
- Platform
- js/wasm
- Imports
- 17 packages
- Last checked
- 2 minutes ago –
Tools for package owners.