mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-11-06 17:14:28 +00:00
Update instance manager tests to use empty NodeConfig slice
This commit is contained in:
@@ -34,7 +34,7 @@ func TestNewInstanceManager(t *testing.T) {
|
|||||||
TimeoutCheckInterval: 5,
|
TimeoutCheckInterval: 5,
|
||||||
}
|
}
|
||||||
|
|
||||||
mgr := manager.NewInstanceManager(backendConfig, cfg, nil)
|
mgr := manager.NewInstanceManager(backendConfig, cfg, []config.NodeConfig{})
|
||||||
if mgr == nil {
|
if mgr == nil {
|
||||||
t.Fatal("NewInstanceManager returned nil")
|
t.Fatal("NewInstanceManager returned nil")
|
||||||
}
|
}
|
||||||
@@ -69,7 +69,7 @@ func TestPersistence(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Test instance persistence on creation
|
// Test instance persistence on creation
|
||||||
manager1 := manager.NewInstanceManager(backendConfig, cfg, nil)
|
manager1 := manager.NewInstanceManager(backendConfig, cfg, []config.NodeConfig{})
|
||||||
options := &instance.CreateInstanceOptions{
|
options := &instance.CreateInstanceOptions{
|
||||||
BackendType: backends.BackendTypeLlamaCpp,
|
BackendType: backends.BackendTypeLlamaCpp,
|
||||||
LlamaServerOptions: &llamacpp.LlamaServerOptions{
|
LlamaServerOptions: &llamacpp.LlamaServerOptions{
|
||||||
@@ -90,7 +90,7 @@ func TestPersistence(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Test loading instances from disk
|
// Test loading instances from disk
|
||||||
manager2 := manager.NewInstanceManager(backendConfig, cfg, nil)
|
manager2 := manager.NewInstanceManager(backendConfig, cfg, []config.NodeConfig{})
|
||||||
instances, err := manager2.ListInstances()
|
instances, err := manager2.ListInstances()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("ListInstances failed: %v", err)
|
t.Fatalf("ListInstances failed: %v", err)
|
||||||
@@ -207,7 +207,7 @@ func createTestManager() manager.InstanceManager {
|
|||||||
DefaultRestartDelay: 5,
|
DefaultRestartDelay: 5,
|
||||||
TimeoutCheckInterval: 5,
|
TimeoutCheckInterval: 5,
|
||||||
}
|
}
|
||||||
return manager.NewInstanceManager(backendConfig, cfg, nil)
|
return manager.NewInstanceManager(backendConfig, cfg, []config.NodeConfig{})
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAutoRestartDisabledInstanceStatus(t *testing.T) {
|
func TestAutoRestartDisabledInstanceStatus(t *testing.T) {
|
||||||
@@ -227,7 +227,7 @@ func TestAutoRestartDisabledInstanceStatus(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create first manager and instance with auto-restart disabled
|
// Create first manager and instance with auto-restart disabled
|
||||||
manager1 := manager.NewInstanceManager(backendConfig, cfg)
|
manager1 := manager.NewInstanceManager(backendConfig, cfg, []config.NodeConfig{})
|
||||||
|
|
||||||
autoRestart := false
|
autoRestart := false
|
||||||
options := &instance.CreateInstanceOptions{
|
options := &instance.CreateInstanceOptions{
|
||||||
@@ -252,7 +252,7 @@ func TestAutoRestartDisabledInstanceStatus(t *testing.T) {
|
|||||||
manager1.Shutdown()
|
manager1.Shutdown()
|
||||||
|
|
||||||
// Create second manager (simulating restart of llamactl)
|
// Create second manager (simulating restart of llamactl)
|
||||||
manager2 := manager.NewInstanceManager(backendConfig, cfg)
|
manager2 := manager.NewInstanceManager(backendConfig, cfg, []config.NodeConfig{})
|
||||||
|
|
||||||
// Get the loaded instance
|
// Get the loaded instance
|
||||||
loadedInst, err := manager2.GetInstance("test-instance")
|
loadedInst, err := manager2.GetInstance("test-instance")
|
||||||
|
|||||||
Reference in New Issue
Block a user