Documentation
¶
Overview ¶
Package executionfake is an in-memory TaskDriver for tests of callers. It keeps the contract's identity, lifecycle and refusal rules; it runs no program. A task's output and exit come from its spec's environment: FAKE_OUTPUT, FAKE_EXIT, and FAKE_BLOCK=1 for a task that runs until stopped.
Index ¶
- type Tasks
- func (f *Tasks) AdmissionOf(key string) execution.Admission
- func (f *Tasks) Capabilities() execution.Capabilities
- func (f *Tasks) Ensure(_ context.Context, spec execution.TaskSpec) (execution.TaskObservation, error)
- func (f *Tasks) Exit(key string, code int)
- func (f *Tasks) ExitOutOfMemory(key string, code int)
- func (f *Tasks) Observe(_ context.Context, ref execution.TaskRef) (execution.TaskObservation, error)
- func (f *Tasks) Output(_ context.Context, ref execution.TaskRef, read execution.OutputRead) (execution.OutputPage, error)
- func (f *Tasks) Present(key string) bool
- func (f *Tasks) Release(_ context.Context, ref execution.TaskRef) error
- func (f *Tasks) ReleaseWorkspace(context.Context, string) error
- func (f *Tasks) Start(_ context.Context, ref execution.TaskRef) error
- func (f *Tasks) Starts(key string) int
- func (f *Tasks) Stop(_ context.Context, ref execution.TaskRef) error
- func (f *Tasks) Wait(ctx context.Context, ref execution.TaskRef) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Tasks ¶
type Tasks struct {
// Now is the clock an admission's expiry is judged by, as a real driver
// is given its caller's (AppTown's) clock: a test that moves that clock
// gives it here. Nil is the system clock.
Now func() time.Time
// contains filtered or unexported fields
}
func (*Tasks) AdmissionOf ¶
AdmissionOf is the admission the task under key was ensured with, kept after it is released.
func (*Tasks) Capabilities ¶
func (f *Tasks) Capabilities() execution.Capabilities
func (*Tasks) ExitOutOfMemory ¶
ExitOutOfMemory ends a running task as Docker does at its memory limit: killed, with code (which a killed child in a pipeline can leave at 0).
func (*Tasks) Output ¶
func (f *Tasks) Output(_ context.Context, ref execution.TaskRef, read execution.OutputRead) (execution.OutputPage, error)
func (*Tasks) Present ¶
Present reports whether a task under key exists (it was ensured and not released).
func (*Tasks) ReleaseWorkspace ¶
ReleaseWorkspace: the fake has no workspaces. Behind a worker, the worker keeps them.