Skip to content

Commit

Permalink
update logging package
Browse files Browse the repository at this point in the history
Signed-off-by: WashingtonKK <[email protected]>
  • Loading branch information
WashingtonKK committed Sep 20, 2024
1 parent c3abf96 commit a7b10cf
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion agent/algorithm/logging_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func TestStderrWrite(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mockEventService := mocks.NewService(t)
mockEventService.On("SendEvent", "AlgorithmRun", manager.Error.String(), mock.Anything).Return(nil)
mockEventService.On("SendEvent", "AlgorithmRun", manager.Warning.String(), mock.Anything).Return(nil)

stderr := &Stderr{Logger: mglog.NewMock(), EventSvc: mockEventService}
n, err := stderr.Write([]byte(tt.input))
Expand Down
2 changes: 1 addition & 1 deletion manager/vm/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func (s *Stderr) Write(p []byte) (n int, err error) {
EventType: manager.VmRunning.String(),
Timestamp: timestamppb.Now(),
Originator: "manager",
Status: manager.Error.String(),
Status: manager.Warning.String(),
},
},
}
Expand Down
2 changes: 1 addition & 1 deletion manager/vm/logging_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func TestStderrWrite(t *testing.T) {
assert.NotNil(t, agentEvent)
assert.Equal(t, "test-computation", agentEvent.ComputationId)
assert.Equal(t, manager.VmRunning.String(), agentEvent.EventType)
assert.Equal(t, manager.Error.String(), agentEvent.Status)
assert.Equal(t, manager.Warning.String(), agentEvent.Status)
assert.NotNil(t, agentEvent.Timestamp)
}
case <-time.After(time.Second):
Expand Down
2 changes: 1 addition & 1 deletion pkg/manager/manager_states.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ type ManagerStatus uint8
const (
Starting ManagerStatus = iota
Stopped
Error
Warning
Disconnected
)
6 changes: 3 additions & 3 deletions pkg/manager/managerstatus_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a7b10cf

Please sign in to comment.