Embed web/dist, run events in-process, manage brew PG18+pgvector, add PI host sidecar and launch --no-docker; unify MiniMax-M2.7-highspeed pins and record dev acceptance.
42 lines
950 B
Go
42 lines
950 B
Go
package localpg
|
|
|
|
import (
|
|
"context"
|
|
"os"
|
|
"path/filepath"
|
|
"testing"
|
|
"time"
|
|
|
|
"chat-agent-system/internal/config"
|
|
)
|
|
|
|
func TestEnsureManagedSmoke(t *testing.T) {
|
|
if testing.Short() {
|
|
// still run — this is the acceptance smoke; skip only if no pg_ctl
|
|
}
|
|
if _, err := ResolveBinDir(); err != nil {
|
|
t.Skip(err)
|
|
}
|
|
t.Setenv("LOCALPG_MODE", "managed")
|
|
dir := t.TempDir()
|
|
cfg := &config.Config{
|
|
Env: "dev",
|
|
DataDir: dir,
|
|
ContextDbHost: "127.0.0.1",
|
|
ContextDbPort: 55433,
|
|
ContextDbUser: "app",
|
|
ContextDbPassword: "dev_secret_db_pass",
|
|
ContextDbName: "agent_system_dev",
|
|
}
|
|
ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second)
|
|
defer cancel()
|
|
h, err := Ensure(ctx, cfg)
|
|
if err != nil {
|
|
t.Fatalf("Ensure: %v", err)
|
|
}
|
|
defer func() { _ = h.Stop() }()
|
|
if _, err := os.Stat(filepath.Join(dir, "pg", "PG_VERSION")); err != nil {
|
|
t.Fatalf("PG_VERSION: %v", err)
|
|
}
|
|
}
|