mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-08-10 16:53:35 +08:00
✨ feat(settings): 支持自定义并持久化日志目录
- 将日志目录配置整合到数据目录设置,支持选择、打开、恢复默认与保存 - 持久化日志目录并保留环境变量优先级,目录调整后重启生效 - 通过跨进程锁和原子写入保护数据目录与日志目录配置 - 移除重复标题并互斥目录修改操作,补齐六语言文案 - 补充桌面接口、浏览器模拟及并发回归测试
This commit is contained in:
@@ -50,6 +50,14 @@ func TestMigrateDataRootContentsCopiesKnownFilesAndDirectories(t *testing.T) {
|
||||
if err := os.WriteFile(filepath.Join(sourceRoot, "jvm_diag_audit.jsonl"), []byte("jvm-diag-audit\n"), 0o644); err != nil {
|
||||
t.Fatalf("write jvm_diag_audit.jsonl failed: %v", err)
|
||||
}
|
||||
for _, excludedName := range []string{
|
||||
filepath.Base(appdata.BootstrapPath()),
|
||||
filepath.Base(appdata.BootstrapLockPath()),
|
||||
} {
|
||||
if err := os.WriteFile(filepath.Join(sourceRoot, excludedName), []byte("bootstrap-only"), 0o600); err != nil {
|
||||
t.Fatalf("write excluded bootstrap file %s: %v", excludedName, err)
|
||||
}
|
||||
}
|
||||
if err := os.MkdirAll(filepath.Join(sourceRoot, "sessions"), 0o755); err != nil {
|
||||
t.Fatalf("mkdir sessions failed: %v", err)
|
||||
}
|
||||
@@ -72,6 +80,14 @@ func TestMigrateDataRootContentsCopiesKnownFilesAndDirectories(t *testing.T) {
|
||||
if got, err := os.ReadFile(filepath.Join(targetRoot, "jvm_diag_audit.jsonl")); err != nil || string(got) != "jvm-diag-audit\n" {
|
||||
t.Fatalf("expected jvm_diag_audit.jsonl to migrate, content=%q err=%v", string(got), err)
|
||||
}
|
||||
for _, excludedName := range []string{
|
||||
filepath.Base(appdata.BootstrapPath()),
|
||||
filepath.Base(appdata.BootstrapLockPath()),
|
||||
} {
|
||||
if _, err := os.Stat(filepath.Join(targetRoot, excludedName)); !os.IsNotExist(err) {
|
||||
t.Fatalf("bootstrap file %s should not migrate, err=%v", excludedName, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestMigrateDataRootContentsReplacesAuditDirectoryWithoutStaleSidecars(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user