Skip to content

Commit

Permalink
test: run Prisma sample app during tests
Browse files Browse the repository at this point in the history
  • Loading branch information
olavloite committed Jun 19, 2024
1 parent 083f267 commit 0ef2839
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/workflows/samples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ jobs:
run: |
npm install
npm start
- name: Run Prisma Sample tests
working-directory: ./samples/nodejs/prisma-sample-app
run: |
npm install
npm start
ruby-samples:
runs-on: ubuntu-latest
steps:
Expand Down
6 changes: 5 additions & 1 deletion samples/nodejs/prisma-sample-app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async function runSample() {
// See https://github.com/GoogleCloudPlatform/pgadapter/tree/postgresql-dialect/samples/cloud-run/nodejs
// for a sample.
const pgAdapter = await startPGAdapter();
const port = 9999; // pgAdapter.getMappedPort(5432);
const port = pgAdapter.getMappedPort(5432);
console.log(`PGAdapter started on port ${port}`);
process.env.DATABASE_URL = `postgresql://localhost:${port}/prisma-sample?options=-c%20spanner.well_known_client=prisma`;

Expand All @@ -57,6 +57,10 @@ async function runSample() {
await printAlbumsReleasedBefore1900();
await updateVenueDescription();
await staleRead();

// Run 'npx prisma migrate deploy' once more, just to verify that we can run this command multiple
// times on an existing database.
await deployMigrations();

await pgAdapter.stop();
}
Expand Down

0 comments on commit 0ef2839

Please sign in to comment.