Documentation ¶
Index ¶
- type MockWR
- func (m *MockWR) Add(cmd string) (string, error)
- func (m *MockWR) GetLastCmd() string
- func (m *MockWR) SetComplete()
- func (m *MockWR) SetRunning()
- func (m *MockWR) Status(string) (wr.WRJobStatus, error)
- func (m *MockWR) Wait(string) (wr.WRJobStatus, error)
- func (m *MockWR) WaitForRunning(string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockWR ¶
type MockWR struct { Cmd string Fail bool PollForStatusInterval time.Duration JobDuration time.Duration sync.RWMutex ReturnStatus wr.WRJobStatus }
MockWR can be used to test a build.Builder without having real wr running.
func NewMockWR ¶
NewMockWR returns a new MockWR that will wait pollForStatusInterval during WaitForRunning() and jobDuration during Wait().
func (*MockWR) GetLastCmd ¶
GetLastCmd returns the last cmd Add()ed.
func (*MockWR) SetComplete ¶
func (m *MockWR) SetComplete()
SetComplete can be used to mock a job that finished running.
func (*MockWR) SetRunning ¶
func (m *MockWR) SetRunning()
SetRunning can be used to mock a job that started running.
func (*MockWR) Status ¶
func (m *MockWR) Status(string) (wr.WRJobStatus, error)
Status implements build.Runner interface.
func (*MockWR) Wait ¶
func (m *MockWR) Wait(string) (wr.WRJobStatus, error)
Wait implements build.Runner interface.
func (*MockWR) WaitForRunning ¶
WaitForRunning implements build.Runner interface.
Click to show internal directories.
Click to hide internal directories.