Each endpoint's tests will be on their own issue branch (PMPR-109, etc.).
The framework branch only contains: CI config, db helpers, migrations.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers full CRUD for each resource via testDb:
- promotions: list, create, get by id, not found, update, delete
- students: list, filter by promo, create, get, not found, update, delete
- roles: list, create, get with permissions, update+reset perms, delete
- modules: list, create, duplicate id rejection, get, not found, update, delete
27 integration tests passing in CI (act + Gitea Actions).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Use apt-get install + configure listen_addresses + md5 auth in pg_hba
so psql can connect via 127.0.0.1 (not just Unix socket)
- Use pg_ctlcluster restart after config changes + wait for pg_isready
- Replace session_replication_role (requires superuser) with a single
TRUNCATE ... CASCADE which handles FK deps without elevated privileges
- All 3 integration tests now pass in CI (act + Gitea Actions)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Generate Drizzle migrations (databases/migrations/)
- Add databases/schema.kit.ts for drizzle-kit (Node-compatible imports)
- Update drizzle.config.ts to use schema.kit.ts
- Add deno tasks: test:unit, test:integration, migrate
- Add tests/helpers/db_integration.ts: testDb, truncateAll, seed helpers
- Add .gitea/workflows/test.yml: CI with postgres service container
- Update lint.yml: run test:unit only (no DB needed)
- Update deploy.yml: add check-code job, gate deploy on it
name:"integration: INSERT user and retrieve by id",
asyncfn() {
awaittruncateAll();
const[role]=awaitseedRoles([{nom:"admin"}]);
const[created]=awaittestDb.insert(users).values({
id:"durand.claire",
nom:"Durand",
prenom:"Claire",
idRole: role.id,
}).returning();
assertExists(created);
assertEquals(created.id,"durand.claire");
assertEquals(created.nom,"Durand");
},
sanitizeResources: false,
sanitizeOps: false,
});
Deno.test({
name:"integration: cleanup - close pool",
asyncfn() {
awaitcloseTestPool();
},
sanitizeResources: false,
sanitizeOps: false,
});
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.