fix(loader): disable config file rewrite during startup
Some checks failed
CI / build-and-test (push) Failing after -32m45s
Some checks failed
CI / build-and-test (push) Failing after -32m45s
* migrate legacy schemas in memory only * log hint to use amcs-migrate-config for persistence
This commit is contained in:
@@ -3,6 +3,7 @@ package config
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
@@ -215,7 +216,15 @@ logging:
|
||||
if err != nil {
|
||||
t.Fatalf("glob backups: %v", err)
|
||||
}
|
||||
if len(entries) != 1 {
|
||||
t.Fatalf("backup files = %d, want 1", len(entries))
|
||||
if len(entries) != 0 {
|
||||
t.Fatalf("backup files = %d, want 0 (load should not rewrite config)", len(entries))
|
||||
}
|
||||
|
||||
originalOnDisk, err := os.ReadFile(configPath)
|
||||
if err != nil {
|
||||
t.Fatalf("read original config: %v", err)
|
||||
}
|
||||
if !strings.Contains(string(originalOnDisk), "provider: \"litellm\"") {
|
||||
t.Fatalf("expected source config to remain unchanged on disk")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user