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:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user