github.com/ActiveState/cli@v0.0.0-20240508170324-6801f60cd051/pkg/platform/runtime/testhelper/eventsmock.go (about) 1 package testhelper 2 3 import "github.com/go-openapi/strfmt" 4 5 type MockProgressOutput struct { 6 BuildStartedCalled bool 7 BuildCompletedCalled bool 8 BuildTotal int64 9 BuildCurrent int 10 InstallationStartedCalled bool 11 InstallationCompletedCalled bool 12 InstallationTotal int64 13 InstallationCurrent int 14 ArtifactStartedCalled int 15 ArtifactIncrementCalled int 16 ArtifactCompletedCalled int 17 ArtifactFailureCalled int 18 } 19 20 func (mpo *MockProgressOutput) BuildStarted(total int64) error { 21 mpo.BuildStartedCalled = true 22 mpo.BuildTotal = total 23 return nil 24 } 25 func (mpo *MockProgressOutput) BuildCompleted(bool) error { 26 mpo.BuildCompletedCalled = true 27 return nil 28 } 29 30 func (mpo *MockProgressOutput) BuildArtifactStarted(artifactID strfmt.UUID, artifactName string) error { 31 return nil 32 } 33 func (mpo *MockProgressOutput) BuildArtifactCompleted(artifactID strfmt.UUID, artifactName, logURI string, cachedBuild bool) error { 34 mpo.BuildCurrent++ 35 return nil 36 } 37 func (mpo *MockProgressOutput) BuildArtifactFailure(artifactID strfmt.UUID, artifactName, logURI string, errorMessage string, cachedBuild bool) error { 38 return nil 39 } 40 func (mpo *MockProgressOutput) BuildArtifactProgress(artifactID strfmt.UUID, artifactName, timeStamp, message, facility, pipeName, source string) error { 41 return nil 42 } 43 44 func (mpo *MockProgressOutput) InstallationStarted(total int64) error { 45 mpo.InstallationStartedCalled = true 46 mpo.InstallationTotal = total 47 return nil 48 } 49 func (mpo *MockProgressOutput) InstallationStatusUpdate(current, total int64) error { 50 mpo.InstallationCurrent = int(current) 51 return nil 52 } 53 func (mpo *MockProgressOutput) InstallationCompleted(bool) error { 54 mpo.InstallationCompletedCalled = true 55 return nil 56 } 57 func (mpo *MockProgressOutput) ArtifactStepStarted(strfmt.UUID, string, string, int64, bool) error { 58 mpo.ArtifactStartedCalled++ 59 return nil 60 } 61 func (mpo *MockProgressOutput) ArtifactStepIncrement(strfmt.UUID, string, string, int64) error { 62 mpo.ArtifactIncrementCalled++ 63 return nil 64 } 65 func (mpo *MockProgressOutput) ArtifactStepCompleted(strfmt.UUID, string, string) error { 66 mpo.ArtifactCompletedCalled++ 67 return nil 68 } 69 func (mpo *MockProgressOutput) ArtifactStepFailure(strfmt.UUID, string, string, string) error { 70 mpo.ArtifactFailureCalled++ 71 return nil 72 } 73 func (mpo *MockProgressOutput) StillBuilding(numCompleted, numTotal int) error { 74 return nil 75 } 76 func (mpo *MockProgressOutput) SolverStart() error { 77 return nil 78 } 79 80 func (mpo *MockProgressOutput) SolverSuccess() error { 81 return nil 82 } 83 func (mpo *MockProgressOutput) Close() error { return nil }