adjust dir structures
Some checks failed
docker-release / build-and-push (push) Failing after 9m59s

This commit is contained in:
2025-11-14 15:02:33 +08:00
parent 960cf59a1d
commit 83bb6623e8
10 changed files with 344 additions and 9 deletions

29
test_helpers_test.go Normal file
View File

@@ -0,0 +1,29 @@
package main
import (
"path/filepath"
"runtime"
"testing"
)
var repoRoot string
func init() {
_, file, _, ok := runtime.Caller(0)
if ok {
repoRoot = filepath.Join(filepath.Dir(file), "..", "..")
}
}
func projectRoot(t *testing.T) string {
t.Helper()
if repoRoot == "" {
t.Fatal("无法定位项目根目录")
}
return repoRoot
}
func configFixture(t *testing.T, name string) string {
t.Helper()
return filepath.Join(projectRoot(t), "internal", "config", "testdata", name)
}