-
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.
feat: add a test with
notablescan
for MongoDB (#24071)
- Loading branch information
Showing
9 changed files
with
635 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { $ } from 'zx' | ||
|
||
import { executeSteps } from '../_utils/executeSteps' | ||
|
||
void executeSteps({ | ||
setup: async () => { | ||
await $`pnpm install` | ||
await $`pnpm prisma version` | ||
await $`pnpm prisma generate` | ||
await $`pnpm prisma db push --force-reset --skip-generate` | ||
}, | ||
test: async () => { | ||
await $`pnpm jest` | ||
}, | ||
finish: async () => { | ||
await $`echo "done"` | ||
}, | ||
// keep: true, // keep docker open to debug it | ||
}) |
19 changes: 19 additions & 0 deletions
19
packages/client/tests/e2e/mongodb-notablescan/docker-compose.yaml
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,19 @@ | ||
version: '3.7' | ||
services: | ||
test-e2e: | ||
environment: | ||
- DATABASE_URL=mongodb://mongo:27017/test_db?retryWrites=true&replicaSet=rs0&directConnection=true | ||
depends_on: | ||
mongo: | ||
condition: service_healthy | ||
|
||
mongo: | ||
image: mongo:7.0 | ||
command: ['--replSet', 'rs0', '--bind_ip_all', '--port', '27017', '--setParameter', 'notablescan=1'] | ||
healthcheck: | ||
test: 'mongosh --port 27017 --eval "try { rs.status() } catch (err) { rs.initiate({_id:\"rs0\",members:[{_id:0,host:\"localhost:27017\"}]}); throw err; }"' | ||
interval: 5s | ||
timeout: 30s | ||
start_period: 0s | ||
start_interval: 1s | ||
retries: 30 |
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 @@ | ||
module.exports = require('../jest.config') |
14 changes: 14 additions & 0 deletions
14
packages/client/tests/e2e/mongodb-notablescan/package.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,14 @@ | ||
{ | ||
"private": true, | ||
"version": "0.0.0", | ||
"main": "index.js", | ||
"scripts": {}, | ||
"dependencies": { | ||
"@prisma/client": "/tmp/prisma-client-0.0.0.tgz" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "29.5.12", | ||
"@types/node": "16.18.96", | ||
"prisma": "/tmp/prisma-0.0.0.tgz" | ||
} | ||
} |
Oops, something went wrong.