woodpecker-helm3/internal/helm/mock_step_test.go
Erin Call 13c663e906
Initialize kubernetes config on upgrade
This change revealed more about how the system needs to work, so there
are some supporting changes:

* helm.upgrade and helm.help are now vars rather than raw functions.
    This allows unit tests to target the "which step should we run"
    logic directly by comparing function pointers, rather than having to
    configure/prepare a fully-valid Plan and then infer the logic’s
    correctness based on the Plan’s state.
* configuration that's specific to kubeconfig initialization is now part
    of the InitKube struct rather than run.Config, since other steps
    shouldn’t need access to those settings (particularly the secrets).
* Step.Execute now receives a run.Config so it can log debug output.
2019-12-16 15:41:04 -08:00

63 lines
1.7 KiB
Go

// Code generated by MockGen. DO NOT EDIT.
// Source: ./internal/helm/plan.go
// Package mock_helm is a generated GoMock package.
package helm
import (
gomock "github.com/golang/mock/gomock"
run "github.com/pelotech/drone-helm3/internal/run"
reflect "reflect"
)
// MockStep is a mock of Step interface
type MockStep struct {
ctrl *gomock.Controller
recorder *MockStepMockRecorder
}
// MockStepMockRecorder is the mock recorder for MockStep
type MockStepMockRecorder struct {
mock *MockStep
}
// NewMockStep creates a new mock instance
func NewMockStep(ctrl *gomock.Controller) *MockStep {
mock := &MockStep{ctrl: ctrl}
mock.recorder = &MockStepMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockStep) EXPECT() *MockStepMockRecorder {
return m.recorder
}
// Prepare mocks base method
func (m *MockStep) Prepare(arg0 run.Config) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Prepare", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Prepare indicates an expected call of Prepare
func (mr *MockStepMockRecorder) Prepare(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Prepare", reflect.TypeOf((*MockStep)(nil).Prepare), arg0)
}
// Execute mocks base method
func (m *MockStep) Execute(arg0 run.Config) error {
m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Execute", arg0)
ret0, _ := ret[0].(error)
return ret0
}
// Execute indicates an expected call of Execute
func (mr *MockStepMockRecorder) Execute(arg0 interface{}) *gomock.Call {
mr.mock.ctrl.T.Helper()
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Execute", reflect.TypeOf((*MockStep)(nil).Execute), arg0)
}