test: prove module database access with PostgreSQL
Add a real installed-module fixture (core/tests/fixtures/module-database-integration/db-facade) with its own manifest, Drizzle schema, drizzle-kit-generated migration, and permissioned HTTP routes, then exercise it end to end in a new apps/api PostgreSQL integration suite: explicit migration application before the module runtime starts (never auto-created), start/stop/HTTP handlers sharing one ModuleDatabase facade by reference, authorized read/mutation/transaction commit and rollback against real PostgreSQL, denied/rejected-origin/OPTIONS/HEAD requests never reaching the module or its table, and both a module-caught and an uncaught real database failure sanitizing exactly as pass 1 established. Registered alongside the existing suites in vitest.migrations.integration.config.ts; no production code, schema, or migration changed.
This commit is contained in:
+28
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"manifestVersion": 3,
|
||||
"id": "db-facade",
|
||||
"name": "Database Facade Integration Test Module",
|
||||
"description": "Test-only installed module fixture proving ModuleDatabase against real PostgreSQL. Never discovered by production startup, Doctor, or normal migration aggregation — only apps/api/tests/module-database.integration.ts points discovery at it explicitly.",
|
||||
"version": "0.1.0",
|
||||
"compatibility": {
|
||||
"platform": "^0.1.0",
|
||||
"moduleSdk": "^0.1.0"
|
||||
},
|
||||
"permissions": [
|
||||
{
|
||||
"id": "db-facade.records.read",
|
||||
"baseline": "public",
|
||||
"description": "Read database facade test records."
|
||||
},
|
||||
{
|
||||
"id": "db-facade.records.write",
|
||||
"baseline": "authenticated",
|
||||
"description": "Write database facade test records."
|
||||
}
|
||||
],
|
||||
"entrypoints": {
|
||||
"server": "./server/index.js",
|
||||
"schema": "./schema/index.js",
|
||||
"migrations": "./drizzle"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user