Documentation
¶
Overview ¶
Package composetest provides a compose.Runner that simulates `docker compose` on top of the in-memory engine from enginetest.
Index ¶
- type Fake
- func (f *Fake) BuildxVersion(context.Context) (string, error)
- func (f *Fake) Config(_ context.Context, s compose.Spec) (*compose.Model, error)
- func (f *Fake) Run(ctx context.Context, s compose.Spec, io compose.IO, args ...string) (int, error)
- func (f *Fake) RunsWith(cmd string) [][]string
- func (f *Fake) Version(context.Context) (compose.Version, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fake ¶
type Fake struct {
Eng *enginetest.Fake
Ver compose.Version
VersionErr error
BuildxErr error
// ConfigFn returns the model for a spec.
ConfigFn func(compose.Spec) (*compose.Model, error)
// Exit returns the exit code of a Run; nil means 0.
Exit func(args []string) int
// Stderr returns what a failing Run prints to stderr.
Stderr func(args []string) string
// Stdout returns what a Run prints to stdout, such as a hook's output.
Stdout func(args []string) string
RunErr error
Runs [][]string
Specs []compose.Spec
// contains filtered or unexported fields
}
Fake simulates Compose: up creates one running container per service, a network and a named volume; stop exits the containers; down removes them (and the volumes with --volumes).
func New ¶
func New(eng *enginetest.Fake, model *compose.Model) *Fake
New returns a Fake that serves model for every spec.
Click to show internal directories.
Click to hide internal directories.