-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: test more unhappy paths, parallelize integration tests
- Loading branch information
1 parent
988d18f
commit 22aa841
Showing
10 changed files
with
134 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/packages/client/src/__tests__/runtime-tests/chmod/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
!dev.db |
Binary file not shown.
33 changes: 33 additions & 0 deletions
33
src/packages/client/src/__tests__/runtime-tests/chmod/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const { PrismaClient } = require('@prisma/client') | ||
const assert = require('assert') | ||
const { getPlatform } = require('@prisma/get-platform') | ||
const fs = require('fs') | ||
const path = require('path') | ||
const stripAnsi = require('strip-ansi') | ||
|
||
module.exports = async () => { | ||
const platform = await getPlatform() | ||
const binaryPath = path.join( | ||
__dirname, | ||
'node_modules/.prisma/client', | ||
`query-engine-${platform}`, | ||
) | ||
fs.chmodSync(binaryPath, '644') | ||
|
||
const prisma = new PrismaClient({ | ||
log: [ | ||
{ | ||
emit: 'event', | ||
level: 'query', | ||
}, | ||
], | ||
}) | ||
|
||
await prisma.user.findMany() | ||
|
||
prisma.disconnect() | ||
} | ||
|
||
if (require.main === module) { | ||
module.exports() | ||
} |
3 changes: 3 additions & 0 deletions
3
src/packages/client/src/__tests__/runtime-tests/chmod/manifest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"shouldSucceed": true | ||
} |
29 changes: 29 additions & 0 deletions
29
src/packages/client/src/__tests__/runtime-tests/chmod/schema.prisma
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
datasource db { | ||
provider = "sqlite" | ||
url = "file:dev.db" | ||
default = true | ||
} | ||
|
||
generator client { | ||
provider = "prisma-client-js" | ||
} | ||
|
||
// / User model comment | ||
model User { | ||
id String @default(uuid()) @id | ||
email String @unique | ||
// / name comment | ||
name String? | ||
posts Post[] | ||
} | ||
|
||
model Post { | ||
id String @default(cuid()) @id | ||
createdAt DateTime @default(now()) | ||
updatedAt DateTime @updatedAt | ||
published Boolean | ||
title String | ||
content String? | ||
authorId String? | ||
author User? @relation(fields: [authorId], references: [id]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.