-
-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Labels
Description
Problem
The Prisma tests (src/storage/prisma.test.ts) are currently excluded from the main test suite and fail to run in CI because the Prisma client is not generated before the tests execute.
Current CI Configuration
Looking at .github/workflows/test.yml, the workflow:
- Sets up PostgreSQL service (lines 25-37)
- Excludes Prisma tests from main test run:
bun run test --exclude '**/prisma.test.ts'(line 56) - Pushes the Prisma schema to the database (lines 63-66)
- Attempts to run Prisma tests (lines 68-71)
However, there's no step to generate the Prisma client between pushing the schema and running the tests.
Why This Fails
The Prisma test file imports from @prisma/client:
import { PrismaClient } from "@prisma/client";This requires the Prisma client to be generated first using prisma generate, which currently doesn't happen in the CI workflow.
Expected Behavior
The Prisma tests should run successfully in CI and verify that the Prisma storage adapter works correctly with PostgreSQL.
Proposed Solution
Add a step to generate the Prisma client before running the tests:
- name: Generate Prisma client
run: bunx prisma generate
env:
DATABASE_URL: postgresql://keypal:keypal_dev@localhost:5432/keypal
- name: Push Prisma schema
run: bunx prisma db push
env:
DATABASE_URL: postgresql://keypal:keypal_dev@localhost:5432/keypal
- name: Run Prisma tests
run: bun run test:prisma
env:
DATABASE_URL: postgresql://keypal:keypal_dev@localhost:5432/keypalAdditional Context
- The
prisma:generatescript exists inpackage.json(line 69) - Docker Compose is set up for local PostgreSQL testing
- Prisma schema is located at
prisma/schema.prisma - Tests cover comprehensive scenarios including CRUD operations, tags, scopes, expiration, and performance testing
Related Files
.github/workflows/test.yml- CI workflow configurationsrc/storage/prisma.test.ts- Prisma test suite (1068 lines)src/storage/prisma.ts- Prisma storage adapter implementationprisma/schema.prisma- Prisma schema definitionpackage.json- Containsprisma:generatescript