Skip to content

Add ORM example smoke tests#8404

Open
AmanVarshney01 wants to merge 3 commits intolatestfrom
add-more-tests
Open

Add ORM example smoke tests#8404
AmanVarshney01 wants to merge 3 commits intolatestfrom
add-more-tests

Conversation

@AmanVarshney01
Copy link
Member

@AmanVarshney01 AmanVarshney01 commented Feb 3, 2026

Summary

  • Expand the ORM smoke-tests so the new suite drives tests/orm.test.ts through Prisma generate, db push, and seed steps for the example projects referenced in the logs
  • Exercise the GraphQL/Next.js/Nest/etc. setups to ensure their Prisma workflows stay in sync as part of the new test coverage

Testing

  • Not run (not requested)

Summary by CodeRabbit

  • Tests

    • Added many deployment-platform placeholder tests (AWS Lambda, Azure, edge runtimes, GCP, Heroku, Railway, Render, Vercel) and expanded ORM/Prisma generator example coverage; introduced SQLite test utility usage and several skipped scaffolding tests.
  • Chores

    • Updated GraphQL–Prisma type/datamodel integration and improved test harness to accept and propagate environment overrides.
    • Bumped Prisma-related packages and adjusted local dev datasource handling for environment-driven URLs.
  • Documentation

    • Clarified edge runtime configuration in a Prisma example.

@coderabbitai
Copy link

coderabbitai bot commented Feb 3, 2026

Walkthrough

Updated ORM GraphQL Prisma typings (import path and PrismaTypes/datamodel structure); extended test suites and added SQLite test helper env propagation; adjusted generator example configs/seeds and updated Prisma generator runtime strings in one example.

Changes

Cohort / File(s) Summary
Prisma types (ORM GraphQL)
orm/graphql/lib/pothos-prisma-types.ts
Changed Prisma client import to ../prisma/generated/client/client.js. Rewrote PrismaTypes with explicit TS model shapes for User/Post and restructured the datamodel content placed alongside getDatamodel(); retained exported getDatamodel() but adjusted its internal structure. Review for correct import path, TS types, and runtime compatibility.
Test fixtures / SQLite helper
tests/fixtures.ts
Extended testSqliteExample to accept options.env?: NodeJS.ProcessEnv, merge with process.env, remove local SQLite DB files before runs, and propagate env (including DATABASE_URL and DIRECT_URL) to npm/prisma subprocesses.
Test additions / updates
tests/databases.test.ts, tests/deployment-platforms.test.ts, tests/generator-prisma-client.test.ts, tests/orm.test.ts
Added new test suites and placeholders; introduced testSqliteExample('databases/turso'); multiple skipped platform and example tests. Verify test scaffolding and env assumptions.
Generator examples — config & seed
generator-prisma-client/basic-typedsql/prisma.config.ts, generator-prisma-client/basic-typedsql/prisma/seed.ts
Changed SQLite datasource path to file:./prisma/dev.db; seed now reads process.env.DATABASE_URL with fallback to file:./prisma/dev.db. Confirm seeds honor env overrides.
Generator example — edge runtime docs & schema
generator-prisma-client/nextjs-starter-webpack-with-middleware/README.md, generator-prisma-client/nextjs-starter-webpack-with-middleware/prisma/schema.prisma
Updated Prisma generator runtime value from "vercel" to "vercel-edge" in README and schema.prisma. Documentation/config change only.
ORM example deps
orm/solid-start/package.json
Bumped Prisma-related dependencies from 7.0.0 to 7.3.0 (@prisma/client, @prisma/adapter-pg, and prisma devDependency). Verify compatibility with updated typings and examples.

Sequence Diagram(s)

(omitted — changes are type/test/config focused and do not introduce new multi-component runtime control flow)

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding smoke tests for ORM examples, which is reflected across multiple test files (orm.test.ts, databases.test.ts, deployment-platforms.test.ts, generator-prisma-client.test.ts) and supporting infrastructure changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@tests/databases.test.ts`:
- Around line 5-7: The section comment "// PostgreSQL examples" is misleading
because testSqliteExample('databases/turso') (and the Turso example) use
LibSQL/SQLite, not PostgreSQL; update the comment or reorganize the block so the
Turso call sits under a "// SQLite/LibSQL examples" comment (or split into
separate PostgreSQL and SQLite sections) and ensure
testExample('databases/prisma-postgres') remains under the PostgreSQL section
while testSqliteExample('databases/turso') is moved or labeled appropriately.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@orm/solid-start/package.json`:
- Around line 10-11: The PR bumps "@prisma/client" and "@prisma/adapter-pg" to
7.3.0 which contains breaking changes; verify compatibility by either pinning
back to a known-working version (e.g., 6.19.0) or updating the schema and code:
check for mapped-enum usage with `@map` and update any code expecting Prisma 7+
mapped-enum behavior, run prisma generate to regenerate types, and run tests and
manual checks for JSON aggregations involving BigInt (ensure consumers handle
BigInt-as-string from relationJoins/JSON aggregation or adjust queries to
cast/convert numeric values); update package.json entries "@prisma/client" and
"@prisma/adapter-pg" accordingly based on the outcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant