refactor: split backend into standalone server project

Remove embedded frontend and workflow editor assets, add standalone API deployment configuration, and retain the current backend service updates.
This commit is contained in:
t
2026-08-20 21:46:55 +08:00
parent 954a3fe8d9
commit 3d47227fbd
612 changed files with 515 additions and 97334 deletions
+39
View File
@@ -4,8 +4,47 @@ import (
"os"
"path/filepath"
"testing"
"agent-desk/internal/pkg/config"
)
func TestNewDialector(t *testing.T) {
t.Parallel()
cases := []struct {
dbType string
want string
}{
{dbType: "sqlite", want: "sqlite"},
{dbType: "mysql", want: "mysql"},
{dbType: "postgres", want: "postgres"},
{dbType: "postgresql", want: "postgres"},
{dbType: " PostgreSQL ", want: "postgres"},
}
for _, tt := range cases {
tt := tt
t.Run(tt.dbType, func(t *testing.T) {
t.Parallel()
dialector, err := newDialector(config.DBConfig{Type: tt.dbType, DSN: ":memory:"})
if err != nil {
t.Fatalf("newDialector() error = %v", err)
}
if got := dialector.Name(); got != tt.want {
t.Fatalf("dialector.Name() = %q, want %q", got, tt.want)
}
})
}
}
func TestNewDialectorRejectsUnsupportedType(t *testing.T) {
t.Parallel()
if _, err := newDialector(config.DBConfig{Type: "oracle"}); err == nil {
t.Fatal("newDialector() error = nil, want unsupported type error")
}
}
func TestSQLiteFilePath(t *testing.T) {
t.Parallel()