* fix: heartbeat/service_test.go test failed
This commit is contained in:
@@ -17,7 +17,7 @@ func TestExecuteHeartbeat_Async(t *testing.T) {
|
|||||||
defer os.RemoveAll(tmpDir)
|
defer os.RemoveAll(tmpDir)
|
||||||
|
|
||||||
hs := NewHeartbeatService(tmpDir, 30, true)
|
hs := NewHeartbeatService(tmpDir, 30, true)
|
||||||
hs.started = true // Enable for testing
|
hs.stopChan = make(chan struct{}) // Enable for testing
|
||||||
|
|
||||||
asyncCalled := false
|
asyncCalled := false
|
||||||
asyncResult := &tools.ToolResult{
|
asyncResult := &tools.ToolResult{
|
||||||
@@ -55,7 +55,7 @@ func TestExecuteHeartbeat_Error(t *testing.T) {
|
|||||||
defer os.RemoveAll(tmpDir)
|
defer os.RemoveAll(tmpDir)
|
||||||
|
|
||||||
hs := NewHeartbeatService(tmpDir, 30, true)
|
hs := NewHeartbeatService(tmpDir, 30, true)
|
||||||
hs.started = true // Enable for testing
|
hs.stopChan = make(chan struct{}) // Enable for testing
|
||||||
|
|
||||||
hs.SetHandler(func(prompt, channel, chatID string) *tools.ToolResult {
|
hs.SetHandler(func(prompt, channel, chatID string) *tools.ToolResult {
|
||||||
return &tools.ToolResult{
|
return &tools.ToolResult{
|
||||||
@@ -93,7 +93,7 @@ func TestExecuteHeartbeat_Silent(t *testing.T) {
|
|||||||
defer os.RemoveAll(tmpDir)
|
defer os.RemoveAll(tmpDir)
|
||||||
|
|
||||||
hs := NewHeartbeatService(tmpDir, 30, true)
|
hs := NewHeartbeatService(tmpDir, 30, true)
|
||||||
hs.started = true // Enable for testing
|
hs.stopChan = make(chan struct{}) // Enable for testing
|
||||||
|
|
||||||
hs.SetHandler(func(prompt, channel, chatID string) *tools.ToolResult {
|
hs.SetHandler(func(prompt, channel, chatID string) *tools.ToolResult {
|
||||||
return &tools.ToolResult{
|
return &tools.ToolResult{
|
||||||
@@ -167,7 +167,7 @@ func TestExecuteHeartbeat_NilResult(t *testing.T) {
|
|||||||
defer os.RemoveAll(tmpDir)
|
defer os.RemoveAll(tmpDir)
|
||||||
|
|
||||||
hs := NewHeartbeatService(tmpDir, 30, true)
|
hs := NewHeartbeatService(tmpDir, 30, true)
|
||||||
hs.started = true // Enable for testing
|
hs.stopChan = make(chan struct{}) // Enable for testing
|
||||||
|
|
||||||
hs.SetHandler(func(prompt, channel, chatID string) *tools.ToolResult {
|
hs.SetHandler(func(prompt, channel, chatID string) *tools.ToolResult {
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user