main.go: remove ~300 lines of stale routes referencing deleted handlers (channels, messages, folders, personas, notes, projects, memories, models, providers, tasks, roles, usage, routing, capabilities, etc.) Fix branding: "Chat Switchboard" → "Switchboard Core" pages: remove chat/notes/projects surface manifests and templates Keep: admin, settings, team-admin, workflow, workflow-landing frontend: delete chat/, notes/, projects/ surface directories (19 files) Delete 5 CSS files (4,144 lines): sw-chat-*, sw-notes-*, sw-projects-* SDK: strip gutted API domains (594→287 lines), remove chatPane/notesPane tests: remove integration_test.go (5,194 lines, broken imports to deleted packages) and perm_enforcement_test.go (551 lines, depended on deleted test helpers). Fix testmain_test.go (remove providers import). openapi.yaml: replace 12,491-line stale spec with kernel auth stub. Full ICD rebuild is Step 8 proper. Auth (builtin, mTLS, OIDC) untouched throughout. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
27 lines
556 B
Go
27 lines
556 B
Go
package handlers
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
"switchboard-core/database"
|
|
|
|
_ "modernc.org/sqlite" // register sqlite driver for DB_DRIVER=sqlite
|
|
)
|
|
|
|
// TestMain sets up the test DB (if available) and runs all tests.
|
|
// DB-dependent tests call database.RequireTestDB(t) to skip gracefully
|
|
// when no DB is configured.
|
|
//
|
|
// Set DB_DRIVER=sqlite to run against SQLite instead of Postgres.
|
|
func TestMain(m *testing.M) {
|
|
gin.SetMode(gin.TestMode)
|
|
|
|
teardown := database.SetupTestDB()
|
|
code := m.Run()
|
|
teardown()
|
|
os.Exit(code)
|
|
}
|