diff --git a/.github/get-ppg-dev/.gitignore b/.github/get-ppg-dev/.gitignore deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/.github/get-ppg-dev/index.js b/.github/get-ppg-dev/index.js deleted file mode 100644 index 86d4a5e01532..000000000000 --- a/.github/get-ppg-dev/index.js +++ /dev/null @@ -1,32 +0,0 @@ -import { context, trace } from "@opentelemetry/api"; -import { AsyncLocalStorageContextManager } from "@opentelemetry/context-async-hooks"; -import { BasicTracerProvider } from "@opentelemetry/sdk-trace-base"; -import { unstable_startServer } from '@prisma/dev' - -context.setGlobalContextManager(new AsyncLocalStorageContextManager()); -trace.setGlobalTracerProvider(new BasicTracerProvider()); - -async function main() { - const server = await unstable_startServer({ - persistenceMode: 'stateless', - }) - - // Emit only the Prisma-compatible URL for CI shell script to capture - console.log(server.ppg.url) - - // Wait for shutdown signal - process.once('SIGTERM', async () => { - await server.close() - process.exit(0) - }) - - process.once('SIGINT', async () => { - await server.close() - process.exit(0) - }) -} - -main().catch((err) => { - console.error('โŒ Failed to start dev server:', err) - process.exit(1) -}) diff --git a/.github/get-ppg-dev/package.json b/.github/get-ppg-dev/package.json deleted file mode 100644 index 568893bbdcaa..000000000000 --- a/.github/get-ppg-dev/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "get-ppg-dev", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "type": "module", - "author": "", - "license": "ISC", - "dependencies": { - "@opentelemetry/api": "1.9.0", - "@opentelemetry/context-async-hooks": "2.2.0", - "@opentelemetry/sdk-trace-base": "2.2.0", - "@prisma/dev": "latest" - } -} diff --git a/.github/scripts/get-packages.js b/.github/scripts/get-packages.js deleted file mode 100644 index ce20f2e3c9a4..000000000000 --- a/.github/scripts/get-packages.js +++ /dev/null @@ -1,38 +0,0 @@ -const glob = require('glob') -const path = require('path') - -const core = require('@actions/core') - -const getTestName = (filePath) => { - return path.dirname(filePath).split(path.sep).pop() -} - -const getBaseFolder = (filePath) => { - let pathTokens = path.dirname(filePath).split(path.sep) - pathTokens.pop() - return pathTokens.pop() -} - -async function main() { - const cwd = process.cwd() - - const files = glob - .sync('**/package.json', { - cwd: cwd, - ignore: '**/node_modules/**', - }) - .filter((file) => { - const folder = getBaseFolder(file) - const allowList = ['orm', 'databases', 'data-modeling'] - return allowList.includes(folder) - }) - .map((file) => { - const folder = getBaseFolder(file) - const test = getTestName(file) - return { path: `${folder}/${test}` } - }) - - core.setOutput('matrix', JSON.stringify({ include: files })) -} - -main() diff --git a/.github/scripts/package.json b/.github/scripts/package.json deleted file mode 100644 index 56a9427eba24..000000000000 --- a/.github/scripts/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "scripts", - "version": "1.0.0", - "main": "index.js", - "license": "MIT", - "devDependencies": { - "glob": "10.4.5" - }, - "dependencies": { - "@actions/core": "1.11.1" - } -} diff --git a/.github/scripts/test-all.sh b/.github/scripts/test-all.sh deleted file mode 100644 index 89936daedc96..000000000000 --- a/.github/scripts/test-all.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh - -set -eu - -item="$1" -dir="$(pwd)" - -echo "" -echo "" -echo "" -echo "" -echo "" -echo "" -echo "---------------------" -echo "running $item" - -case "$item" in - *".github"*|*"deployment-platforms"*|*"databases"*) - echo "ignoring $item" - exit 0 - ;; -esac - -cd "$(dirname "$item")/" - -## ACTION - -echo "+++++++++++" -echo "executing .github/tests/$(dirname "$item")/run.sh (tests)" -run_file="$dir/.github/tests/$(dirname "$item")/run.sh" - -if [ -f "$run_file" ]; then - set +e - bash "$run_file" - code=$? - set -e - - cd "$dir" - - if [ $code -ne 0 ]; then - echo "$(dirname "$item") failed" - exit $code - fi -else - echo "no test file set up for $item," - echo "please create a test shell file at $run_file" - exit 1 -fi - -## END - -echo "$item done" - -# somehow ports are still in use in GitHub actions, so kill everything here again -pkill node || true diff --git a/.github/tests/README.md b/.github/tests/README.md deleted file mode 100644 index e6bfe5a5a4fd..000000000000 --- a/.github/tests/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# Tests - -This internal directory defines test scripts for our CI. Each project gets its -own test script, but we use this hidden directory so we don't need to define it -in each public project, since users checking out our examples don't care about -that. diff --git a/.github/tests/data-modeling/delegated-types/run.sh b/.github/tests/data-modeling/delegated-types/run.sh deleted file mode 100644 index 7aab6f474a72..000000000000 --- a/.github/tests/data-modeling/delegated-types/run.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -set -eu - -npm install -npx prisma migrate dev --name init -npm run test diff --git a/.github/tests/databases/postgresql-supabase/run.sh b/.github/tests/databases/postgresql-supabase/run.sh deleted file mode 100644 index ab052ffa23e9..000000000000 --- a/.github/tests/databases/postgresql-supabase/run.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -# A blank script that always passes -true diff --git a/.github/tests/databases/prisma-postgres/run.sh b/.github/tests/databases/prisma-postgres/run.sh deleted file mode 100644 index 8e4ebd1ca802..000000000000 --- a/.github/tests/databases/prisma-postgres/run.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash -set -euo pipefail - -# Move to Prisma project -cd ../../../.. -cd databases/prisma-postgres - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [[ "$WAITED" -ge "$MAX_WAIT" ]]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null # Go back to databases/prisma-postgres - -# Run migration -echo "๐Ÿ“ Running prisma migrate dev..." -npx prisma migrate dev --name init --skip-seed - -# Run queries (if any) -echo "๐Ÿงช Running queries..." -npm run queries || echo "โ„น๏ธ No queries script defined." - -# Cleanup -echo "๐Ÿ›‘ Shutting down Prisma Dev (PID $NODE_PID)..." -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/databases/sql-server/run.sh b/.github/tests/databases/sql-server/run.sh deleted file mode 100644 index ab052ffa23e9..000000000000 --- a/.github/tests/databases/sql-server/run.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -# A blank script that always passes -true diff --git a/.github/tests/orm/ai-sdk-nextjs/run.sh b/.github/tests/orm/ai-sdk-nextjs/run.sh deleted file mode 100644 index c284b89201bf..000000000000 --- a/.github/tests/orm/ai-sdk-nextjs/run.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/ai-sdk-nextjs" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null - -npm install -npx prisma migrate dev --name init --schema prisma/schema.prisma -npx prisma db seed -npm run dev & -pid=$! - -sleep 15 - -# check frontend -curl --fail 'http://localhost:3000/' - -kill "$pid" -echo "๐Ÿ›‘ App stopped (PID $pid)" -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/astro/run.sh b/.github/tests/orm/astro/run.sh deleted file mode 100644 index 1f1111d69ae2..000000000000 --- a/.github/tests/orm/astro/run.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/astro" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null - -npm install -npx prisma migrate dev --name init --schema prisma/schema.prisma -npm run dev & -pid=$! - -sleep 15 - -# check frontend -curl --fail 'http://localhost:4321/' - - -kill "$pid" -echo "๐Ÿ›‘ App stopped (PID $pid)" -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/authjs-nextjs/run.sh b/.github/tests/orm/authjs-nextjs/run.sh deleted file mode 100644 index 21e22765a624..000000000000 --- a/.github/tests/orm/authjs-nextjs/run.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/authjs-nextjs" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null - -npm install -npx prisma migrate dev --name init --schema prisma/schema.prisma -npx prisma db seed -npm run dev & -pid=$! - -sleep 15 - -# check frontend -curl --fail 'http://localhost:3000/' - -kill "$pid" -echo "๐Ÿ›‘ App stopped (PID $pid)" -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/betterauth-astro/run.sh b/.github/tests/orm/betterauth-astro/run.sh deleted file mode 100644 index 73197208e3ec..000000000000 --- a/.github/tests/orm/betterauth-astro/run.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/betterauth-astro" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null - -npm install -npx prisma migrate dev --name init --schema prisma/schema.prisma -npm run dev & -pid=$! - -sleep 15 - -# check frontend -curl --fail 'http://localhost:4321/' - - -kill "$pid" -echo "๐Ÿ›‘ App stopped (PID $pid)" -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/betterauth-nextjs/run.sh b/.github/tests/orm/betterauth-nextjs/run.sh deleted file mode 100644 index 8c225943cdce..000000000000 --- a/.github/tests/orm/betterauth-nextjs/run.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/betterauth-nextjs" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null - -npm install -npx prisma migrate dev --name init --schema prisma/schema.prisma -npx prisma db seed -npm run dev & -pid=$! - -sleep 15 - -# check frontend -curl --fail 'http://localhost:3000/' - -kill "$pid" -echo "๐Ÿ›‘ App stopped (PID $pid)" -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/clerk-astro/run.sh b/.github/tests/orm/clerk-astro/run.sh deleted file mode 100644 index 8c3622170e1b..000000000000 --- a/.github/tests/orm/clerk-astro/run.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/clerk-astro" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null - -npm install -npx prisma migrate dev --name init -npm run dev & -pid=$! - -sleep 15 - -# check frontend -curl --fail 'http://localhost:3000/' - -kill "$pid" -echo "๐Ÿ›‘ App stopped (PID $pid)" -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/clerk-nextjs/run.sh b/.github/tests/orm/clerk-nextjs/run.sh deleted file mode 100644 index c01289666f19..000000000000 --- a/.github/tests/orm/clerk-nextjs/run.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/clerk-nextjs" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null - -npm install -npx prisma migrate dev --name init -npm run dev & -pid=$! - -sleep 15 - -# check frontend -curl --fail 'http://localhost:3000/' - -kill "$pid" -echo "๐Ÿ›‘ App stopped (PID $pid)" -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/cloudflare-workers/run.sh b/.github/tests/orm/cloudflare-workers/run.sh deleted file mode 100644 index 376623cfbcb4..000000000000 --- a/.github/tests/orm/cloudflare-workers/run.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/cloudflare-workers" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null - -npm install -npx prisma migrate dev --name init --schema prisma/schema.prisma -npx prisma db seed -npm run dev & -pid=$! - -sleep 15 - -# check frontend -curl --fail 'http://localhost:3000/' - -kill "$pid" -echo "๐Ÿ›‘ App stopped (PID $pid)" -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/express/run.sh b/.github/tests/orm/express/run.sh deleted file mode 100755 index 1ac18f61645a..000000000000 --- a/.github/tests/orm/express/run.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/express" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null # Back to databases/prisma-postgres - -# Run migrations + seed -npx prisma migrate dev --name init -npx prisma db seed - -# Start the app -npm run dev & -pid=$! - -sleep 20 - -# Run Postman tests (relative to where the script was originally called) -npx newman run "$REPO_ROOT/.github/tests/postman_collections/rest.json" --bail - - -kill "$pid" -echo "๐Ÿ›‘ App stopped (PID $pid)" -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/fastify-graphql-sdl-first/run.sh b/.github/tests/orm/fastify-graphql-sdl-first/run.sh deleted file mode 100644 index bf5c405993a9..000000000000 --- a/.github/tests/orm/fastify-graphql-sdl-first/run.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup for fastify-graphql-sdl-first..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/fastify-graphql-sdl-first" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null # Back to orm/fastify-graphql-sdl-first - -# Run migrations and seed -npx prisma migrate dev --name init -npx prisma db seed - -# Start the app -npm run dev & -pid=$! - -sleep 20 - -# Run GraphQL Postman collection -echo "๐Ÿงช Running Postman tests..." -npx newman run "$REPO_ROOT/.github/tests/postman_collections/graphql-hapi.json" --bail - -# Cleanup -echo "๐Ÿ›‘ Shutting down app (PID $pid) and Prisma Dev (PID $NODE_PID)..." -kill "$pid" -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/fastify-graphql/run.sh b/.github/tests/orm/fastify-graphql/run.sh deleted file mode 100644 index 97b81285598f..000000000000 --- a/.github/tests/orm/fastify-graphql/run.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup for fastify-graphql..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/fastify-graphql" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null # Back to orm/fastify-graphql - -# Run migrations and seed -npx prisma migrate reset --force --skip-seed -npx prisma migrate dev --name init -npx prisma db seed - -# Start the app -npm run dev & -pid=$! - -sleep 20 - -# Run GraphQL Postman tests -echo "๐Ÿงช Running Postman tests..." -npx newman run "$REPO_ROOT/.github/tests/postman_collections/graphql-hapi.json" --bail - -# Cleanup -echo "๐Ÿ›‘ Shutting down app (PID $pid) and Prisma Dev (PID $NODE_PID)..." -kill "$pid" -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/fastify/run.sh b/.github/tests/orm/fastify/run.sh deleted file mode 100644 index ce97da683288..000000000000 --- a/.github/tests/orm/fastify/run.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup for fastify..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/fastify" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null # Back to orm/fastify - -# Run migrations and seed -npx prisma migrate dev --name init -npx prisma db seed - -# Start the app -npm run dev & -pid=$! - -sleep 20 - -# Run REST Postman tests -echo "๐Ÿงช Running Postman tests..." -npx newman run "$REPO_ROOT/.github/tests/postman_collections/rest.json" --bail - -# Cleanup -echo "๐Ÿ›‘ Shutting down app (PID $pid) and Prisma Dev (PID $NODE_PID)..." -kill "$pid" -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/graphql-auth/run.sh b/.github/tests/orm/graphql-auth/run.sh deleted file mode 100644 index 153290cf1432..000000000000 --- a/.github/tests/orm/graphql-auth/run.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup for graphql-auth..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/graphql-auth" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null # Back to orm/graphql-auth - -# Run migrations and seed -npx prisma migrate dev --name init -npx prisma db seed - -# Start the app -npm run dev & -pid=$! - -sleep 15 - -# Test GraphQL endpoint -echo "๐Ÿงช Testing GraphQL API..." -curl --fail 'http://localhost:4000/' \ - -H 'Accept-Encoding: gzip, deflate, br' \ - -H 'Content-Type: application/json' \ - -H 'Accept: application/json' \ - -H 'Connection: keep-alive' \ - -H 'DNT: 1' \ - -H 'Origin: http://localhost:4000' \ - --data-binary '{"query":"query {\n feed {\n id\n content\n author {\n id\n name\n email\n }\n }\n}"}' \ - --compressed - -# Cleanup -echo "๐Ÿ›‘ Shutting down app (PID $pid) and Prisma Dev (PID $NODE_PID)..." -kill "$pid" -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/graphql-nexus/run.sh b/.github/tests/orm/graphql-nexus/run.sh deleted file mode 100644 index 5942d32c008a..000000000000 --- a/.github/tests/orm/graphql-nexus/run.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup for graphql-nexus..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/graphql-nexus" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null # Back to orm/graphql-nexus - -# Run migrations and seed -npx prisma migrate reset --force --skip-seed -npx prisma migrate dev --name init -npx prisma db seed - -# Start the app -npm run dev & -pid=$! - -sleep 20 - -# Run GraphQL Newman test -echo "๐Ÿงช Running Newman tests..." -npx newman run ../../.github/tests/postman_collections/graphql.json --bail --verbose - -# Cleanup -echo "๐Ÿ›‘ Shutting down app (PID $pid) and Prisma Dev (PID $NODE_PID)..." -kill "$pid" -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/graphql-sdl-first/run.sh b/.github/tests/orm/graphql-sdl-first/run.sh deleted file mode 100644 index 24eda9d645eb..000000000000 --- a/.github/tests/orm/graphql-sdl-first/run.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup for graphql-sdl-first..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/graphql-sdl-first" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null # Back to orm/graphql-sdl-first - -# Run migrations and seed -npx prisma migrate dev --name init -npx prisma db seed - -# Start the app -npm run dev & -pid=$! - -sleep 20 - -# Run GraphQL Newman test -echo "๐Ÿงช Running Newman tests..." -npx newman run ../../.github/tests/postman_collections/graphql.json --bail - -# Cleanup -echo "๐Ÿ›‘ Shutting down app (PID $pid) and Prisma Dev (PID $NODE_PID)..." -kill "$pid" -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/graphql-subscriptions/run.sh b/.github/tests/orm/graphql-subscriptions/run.sh deleted file mode 100644 index 4d00d09639d9..000000000000 --- a/.github/tests/orm/graphql-subscriptions/run.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup for graphql-subscriptions..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/graphql-subscriptions" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null # Back to orm/graphql-subscriptions - -# Run migrations and seed -npx prisma migrate dev --name init -npx prisma db seed - -# Start the GraphQL subscriptions server -echo "๐Ÿš€ Starting app..." -npm run dev & -pid=$! - -sleep 15 - -# Run test query -echo "๐Ÿ”Ž Running sample GraphQL query..." -curl --fail 'http://localhost:4000/graphql' \ - -H 'Accept-Encoding: gzip, deflate, br' \ - -H 'Content-Type: application/json' \ - -H 'Accept: application/json' \ - -H 'Connection: keep-alive' \ - -H 'DNT: 1' \ - -H 'Origin: http://localhost:4000' \ - --data-binary '{"query":"query {\n feed {\n id\n title\n content\n }\n}"}' \ - --compressed - -# Cleanup -echo "๐Ÿ›‘ Shutting down app (PID $pid) and Prisma Dev (PID $NODE_PID)..." -kill "$pid" -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/graphql/run.sh b/.github/tests/orm/graphql/run.sh deleted file mode 100644 index df45db90b3d9..000000000000 --- a/.github/tests/orm/graphql/run.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup for graphql..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/graphql" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null # Back to orm/graphql - -# Run migrations and seed -npx prisma migrate reset --force --skip-seed -npx prisma migrate dev --name init -npx prisma db seed - -# Start the app -npm run dev & -pid=$! - -sleep 20 - -# Run GraphQL Postman collection -echo "๐Ÿงช Running Postman tests..." -npx newman run "$REPO_ROOT/.github/tests/postman_collections/graphql.json" --bail - -# Cleanup -echo "๐Ÿ›‘ Shutting down app (PID $pid) and Prisma Dev (PID $NODE_PID)..." -kill "$pid" -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/grpc/run.sh b/.github/tests/orm/grpc/run.sh deleted file mode 100644 index 2c7475d63d77..000000000000 --- a/.github/tests/orm/grpc/run.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup for grpc..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/grpc" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null # Back to orm/grpc - -# Run migrations and seed -npx prisma migrate dev --name init -npx prisma db seed - -# Start the gRPC app -echo "๐Ÿš€ Starting gRPC app..." -npm run dev & -pid=$! - -sleep 10 - -# Trigger gRPC query logic (e.g. feeding test data) -echo "๐Ÿงช Running feed task..." -npm run feed - -# Cleanup -echo "๐Ÿ›‘ Shutting down gRPC app (PID $pid) and Prisma Dev (PID $NODE_PID)..." -kill "$pid" -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/hapi-graphql-sdl-first/run.sh b/.github/tests/orm/hapi-graphql-sdl-first/run.sh deleted file mode 100644 index 88e94af66f6b..000000000000 --- a/.github/tests/orm/hapi-graphql-sdl-first/run.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup for hapi-graphql-sdl-first..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/hapi-graphql-sdl-first" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null # Back to orm/hapi-graphql-sdl-first - -# Run migrations and seed -npx prisma migrate dev --name init -npx prisma db seed - -# Start the app -echo "๐Ÿš€ Starting Hapi GraphQL app..." -npm run dev & -pid=$! - -sleep 20 - -# Run Postman test -echo "๐Ÿงช Running Newman test for GraphQL Hapi..." -npx newman run "$REPO_ROOT/.github/tests/postman_collections/graphql-hapi.json" --bail - -# Cleanup -echo "๐Ÿ›‘ Shutting down Hapi app (PID $pid) and Prisma Dev (PID $NODE_PID)..." -kill "$pid" -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/hapi-graphql/run.sh b/.github/tests/orm/hapi-graphql/run.sh deleted file mode 100644 index 1cf3ba81cb58..000000000000 --- a/.github/tests/orm/hapi-graphql/run.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup for hapi-graphql..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/hapi-graphql" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null # Back to orm/hapi-graphql - -# Run migrations and seed -npx prisma migrate dev --name init -npx prisma db seed - -# Start the app -echo "๐Ÿš€ Starting Hapi GraphQL app..." -npm run dev & -pid=$! - -sleep 20 - -# Run Postman test -echo "๐Ÿงช Running Newman test for GraphQL Hapi..." -npx newman run "$REPO_ROOT/.github/tests/postman_collections/graphql-hapi.json" --bail - -# Cleanup -echo "๐Ÿ›‘ Shutting down Hapi app (PID $pid) and Prisma Dev (PID $NODE_PID)..." -kill "$pid" -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/hapi/run.sh b/.github/tests/orm/hapi/run.sh deleted file mode 100644 index f0b734f5fc30..000000000000 --- a/.github/tests/orm/hapi/run.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup for hapi..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/hapi" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null # Back to orm/hapi - -# Run migrations and seed -npx prisma migrate dev --name init -npx prisma db seed - -# Start the app -echo "๐Ÿš€ Starting Hapi app..." -npm run dev & -pid=$! - -sleep 20 - -# Run REST tests via Postman -echo "๐Ÿงช Running Newman test for REST API..." -npx newman run "$REPO_ROOT/.github/tests/postman_collections/rest.json" --bail - -# Cleanup -echo "๐Ÿ›‘ Shutting down Hapi app (PID $pid) and Prisma Dev (PID $NODE_PID)..." -kill "$pid" -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/hono/run.sh b/.github/tests/orm/hono/run.sh deleted file mode 100644 index 7d10e7676f8d..000000000000 --- a/.github/tests/orm/hono/run.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup for hono..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/hono" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null # Back to orm/hono - -# Run migrations and seed -npx prisma migrate dev --name init -npx prisma db seed - -# Start the app -echo "๐Ÿš€ Starting Hono app..." -npm run dev & -pid=$! - -sleep 15 - -# Check frontend -echo "๐Ÿ”Ž Verifying root frontend route..." -curl --fail 'http://localhost:3000/' - -# Cleanup -echo "๐Ÿ›‘ Shutting down Hono app (PID $pid) and Prisma Dev (PID $NODE_PID)..." -kill "$pid" -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/koa/run.sh b/.github/tests/orm/koa/run.sh deleted file mode 100644 index 8f4103b0b8a2..000000000000 --- a/.github/tests/orm/koa/run.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup for koa..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/koa" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null # Back to orm/koa - -# Run migrations and seed -npx prisma migrate reset --force --skip-seed -npx prisma migrate dev --name init -npx prisma db seed - -# Start the app -echo "๐Ÿš€ Starting Koa app..." -npm run dev & -pid=$! - -sleep 20 - -# Run Postman test -echo "๐Ÿงช Running Newman test for REST Koa..." -npx newman run "$REPO_ROOT/.github/tests/postman_collections/rest.json" --bail - -# Cleanup -echo "๐Ÿ›‘ Shutting down Koa app (PID $pid) and Prisma Dev (PID $NODE_PID)..." -kill "$pid" -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/nest-graphql-sdl-first/run.sh b/.github/tests/orm/nest-graphql-sdl-first/run.sh deleted file mode 100644 index 38f301ab0c63..000000000000 --- a/.github/tests/orm/nest-graphql-sdl-first/run.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup for nest-graphql-sdl-first..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/nest-graphql-sdl-first" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null # Back to orm/nest-graphql-sdl-first - -# Run migrations and seed -npx prisma migrate dev --name init -npx prisma db seed - -# Start the app -echo "๐Ÿš€ Starting NestJS GraphQL app..." -npm run dev & -pid=$! - -sleep 20 - -# Run Postman GraphQL test -echo "๐Ÿงช Running Newman test for NestJS GraphQL..." -npx newman run "$REPO_ROOT/.github/tests/postman_collections/graphql-nestjs.json" --bail - -# Cleanup -echo "๐Ÿ›‘ Shutting down NestJS app (PID $pid) and Prisma Dev (PID $NODE_PID)..." -kill "$pid" -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/nest-graphql/run.sh b/.github/tests/orm/nest-graphql/run.sh deleted file mode 100644 index 2273f55d3d48..000000000000 --- a/.github/tests/orm/nest-graphql/run.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup for nest-graphql..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/nest-graphql" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null # Back to orm/nest-graphql - -# Run migrations and seed -npx prisma migrate dev --name init -npx prisma db seed - -# Start the app -echo "๐Ÿš€ Starting NestJS GraphQL app..." -npm run dev & -pid=$! - -sleep 20 - -# Run Postman test -echo "๐Ÿงช Running Newman test for NestJS GraphQL..." -npx newman run "$REPO_ROOT/.github/tests/postman_collections/graphql-nestjs.json" --bail - -# Cleanup -echo "๐Ÿ›‘ Shutting down NestJS app (PID $pid) and Prisma Dev (PID $NODE_PID)..." -kill "$pid" -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/nest/run.sh b/.github/tests/orm/nest/run.sh deleted file mode 100644 index 1767486756cf..000000000000 --- a/.github/tests/orm/nest/run.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup for nest..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/nest" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null # Back to orm/nest - -# Run migrations and seed -npx prisma migrate reset --force --skip-seed -npx prisma migrate dev --name init -npx prisma db seed - -# Start the app -echo "๐Ÿš€ Starting NestJS app..." -npm run dev & -pid=$! - -sleep 20 - -# Run Postman test -echo "๐Ÿงช Running Newman test for REST NestJS..." -npx newman run "$REPO_ROOT/.github/tests/postman_collections/rest.json" --bail - -# Cleanup -echo "๐Ÿ›‘ Shutting down NestJS app (PID $pid) and Prisma Dev (PID $NODE_PID)..." -kill "$pid" -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/nextjs-graphql/run.sh b/.github/tests/orm/nextjs-graphql/run.sh deleted file mode 100644 index 8a4aaba08b3a..000000000000 --- a/.github/tests/orm/nextjs-graphql/run.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup for nextjs-graphql..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/nextjs-graphql" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null # Back to orm/nextjs-graphql - -# Run migrations and seed -npx prisma migrate dev --name init -npx prisma db seed - -# Start the app -echo "๐Ÿš€ Starting Next.js app..." -npm run dev & -pid=$! - -sleep 15 - -# Check GraphQL API -echo "๐Ÿ”Ž Verifying /api/graphql endpoint..." -curl --fail 'http://localhost:3000/api/graphql' \ - -H 'Accept-Encoding: gzip, deflate, br' \ - -H 'Content-Type: application/json' \ - -H 'Accept: application/json' \ - -H 'Connection: keep-alive' \ - -H 'DNT: 1' \ - -H 'Origin: http://localhost:4000' \ - --data-binary '{"query":"query {\n feed {\n id\n content\n author {\n id\n name\n email\n }\n }\n}"}' \ - --compressed - -# Check frontend -echo "๐Ÿ”Ž Verifying root frontend route..." -curl --fail 'http://localhost:3000/' - -# Cleanup -echo "๐Ÿ›‘ Shutting down Next.js app (PID $pid) and Prisma Dev (PID $NODE_PID)..." -kill "$pid" -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/nextjs-trpc/run.sh b/.github/tests/orm/nextjs-trpc/run.sh deleted file mode 100644 index 159c0d53a754..000000000000 --- a/.github/tests/orm/nextjs-trpc/run.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup for nextjs-trpc..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/nextjs-trpc" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install --legacy-peer-deps - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null - -# Run migrations -npx prisma migrate dev --name init - -# Start the app -echo "๐Ÿš€ Starting Next.js app..." -npm run dev & -pid=$! - -sleep 15 - -# Check frontend (Next defaults to port 3000) -echo "๐Ÿ”Ž Verifying root frontend route..." -curl --fail 'http://localhost:3000/' - -# Cleanup -echo "๐Ÿ›‘ Shutting down Next.js app (PID $pid) and Prisma Dev (PID $NODE_PID)..." -kill "$pid" -kill "$NODE_PID" -wait "$NODE_PID" || true - - diff --git a/.github/tests/orm/nextjs/run.sh b/.github/tests/orm/nextjs/run.sh deleted file mode 100644 index cf632322516e..000000000000 --- a/.github/tests/orm/nextjs/run.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup for nextjs..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/nextjs" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null # Back to orm/nextjs - -# Run migrations and seed -npx prisma migrate dev --name init -npx prisma db seed - -# Start the app -echo "๐Ÿš€ Starting Next.js app..." -npm run dev & -pid=$! - -sleep 15 - -# Check frontend -echo "๐Ÿ”Ž Verifying root frontend route..." -curl --fail 'http://localhost:3000/' - -# Cleanup -echo "๐Ÿ›‘ Shutting down Next.js app (PID $pid) and Prisma Dev (PID $NODE_PID)..." -kill "$pid" -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/nuxt-prisma-module/run.sh b/.github/tests/orm/nuxt-prisma-module/run.sh deleted file mode 100644 index d1e6d88a2695..000000000000 --- a/.github/tests/orm/nuxt-prisma-module/run.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -# This script simply returns true -exit 0 diff --git a/.github/tests/orm/nuxt/run.sh b/.github/tests/orm/nuxt/run.sh deleted file mode 100644 index ae5fbe2f90d5..000000000000 --- a/.github/tests/orm/nuxt/run.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup for nuxt..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/nuxt" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null # Back to orm/nuxt - -# Run migration + seed -npx prisma migrate dev --name init -npx prisma db seed - -# Start the app -echo "๐Ÿงช Starting Nuxt app..." -npm run dev & -pid=$! - -sleep 15 - -# Check frontend -echo "๐Ÿ”Ž Checking http://localhost:3000/" -curl --fail 'http://localhost:3000/' - -# Cleanup -echo "๐Ÿ›‘ Shutting down Nuxt app (PID $pid) and Prisma Dev (PID $NODE_PID)..." -kill "$pid" -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/postgis-express/run.sh b/.github/tests/orm/postgis-express/run.sh deleted file mode 100644 index 1ef02f838dce..000000000000 --- a/.github/tests/orm/postgis-express/run.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -set -eu - -npm install && npm run test diff --git a/.github/tests/orm/prisma-mocking-javascript/run.sh b/.github/tests/orm/prisma-mocking-javascript/run.sh deleted file mode 100644 index c0474751b08c..000000000000 --- a/.github/tests/orm/prisma-mocking-javascript/run.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -set -eu - -npm install -npx prisma generate - -npm run test diff --git a/.github/tests/orm/react-router-7/run.sh b/.github/tests/orm/react-router-7/run.sh deleted file mode 100644 index 087721f9043f..000000000000 --- a/.github/tests/orm/react-router-7/run.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup for react-router-7..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/react-router-7" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null # Back to orm/react-router-7 - -# Run migrations and seed -echo "๐Ÿ“ Running Prisma migrations and seeding..." -DATABASE_URL="$DATABASE_URL" npx prisma migrate reset --force --skip-seed -DATABASE_URL="$DATABASE_URL" npx prisma migrate dev --name init -DATABASE_URL="$DATABASE_URL" npx prisma db seed - -# Start the app -echo "๐Ÿš€ Starting the React Router 7 app..." -npm run dev & -pid=$! - -# Wait for server -sleep 15 - -# Test frontend -echo "๐Ÿงช Checking frontend response..." -curl --fail 'http://localhost:5173' - -# Cleanup -echo "๐Ÿ›‘ Shutting down React Router app (PID $pid) and Prisma Dev (PID $NODE_PID)..." -kill "$pid" -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/script/run.sh b/.github/tests/orm/script/run.sh deleted file mode 100644 index 73762b826565..000000000000 --- a/.github/tests/orm/script/run.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup for script..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/script" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null # Back to orm/script - -# Run migrations (reset and dev) -npx prisma migrate dev --name init - -# Run script (assumes it terminates; remove `&` if it blocks) -npm run dev - -# Cleanup Prisma Dev server -echo "๐Ÿ›‘ Shutting down Prisma Dev (PID $NODE_PID)..." -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/solid-start/run.sh b/.github/tests/orm/solid-start/run.sh deleted file mode 100644 index 2a152354c85f..000000000000 --- a/.github/tests/orm/solid-start/run.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup for solid-start..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/solid-start" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null # Back to orm/solid-start - -# Run migrations -npx prisma migrate dev --name init - -# Start the app -echo "๐Ÿงช Starting app..." -npm run dev & -pid=$! - -sleep 15 - -# Check frontend -echo "๐Ÿ”Ž Checking http://localhost:3000/" -curl --fail 'http://localhost:3000/' - -# Cleanup -echo "๐Ÿ›‘ Shutting down app (PID $pid) and Prisma Dev (PID $NODE_PID)..." -kill "$pid" -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/starter/run.sh b/.github/tests/orm/starter/run.sh deleted file mode 100644 index 47eca0c26905..000000000000 --- a/.github/tests/orm/starter/run.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -set -eu - -npm install -npm run build diff --git a/.github/tests/orm/sveltekit/run.sh b/.github/tests/orm/sveltekit/run.sh deleted file mode 100644 index 60043b80d814..000000000000 --- a/.github/tests/orm/sveltekit/run.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup for sveltekit..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/sveltekit" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null # Back to orm/sveltekit - -# Run migrations + seed -npx prisma migrate dev --name init --schema prisma/schema.prisma -npx prisma db seed - -# Start the app -echo "๐Ÿงช Starting app..." -npm run dev & -pid=$! - -sleep 15 - -# Check frontend -echo "๐Ÿ”Ž Checking http://localhost:5173/" -curl --fail 'http://localhost:5173/' - -# Cleanup -echo "๐Ÿ›‘ Shutting down app (PID $pid) and Prisma Dev (PID $NODE_PID)..." -kill "$pid" -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/testing-express/run.sh b/.github/tests/orm/testing-express/run.sh deleted file mode 100644 index 11ff07d97770..000000000000 --- a/.github/tests/orm/testing-express/run.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash - -set -eu - -echo "๐Ÿ” Starting test setup for testing-express..." - -echo "๐Ÿ“‚ Current working directory before REPO_ROOT: $(pwd)" -echo "๐Ÿ“ Listing contents:" -ls -la - -REPO_ROOT="$(git rev-parse --show-toplevel)" -echo "๐Ÿ“Œ Detected repo root: $REPO_ROOT" - -cd "$REPO_ROOT/orm/testing-express" -echo "๐Ÿ“‚ Changed directory to: $(pwd)" - -echo "๐Ÿ“ฆ Installing test deps..." -npm install - -# Go to Node script dir and install its deps -NODE_SCRIPT_DIR="../../.github/get-ppg-dev" -pushd "$NODE_SCRIPT_DIR" > /dev/null -npm install - -# Start Prisma Dev server -LOG_FILE="./ppg-dev-url.log" -rm -f "$LOG_FILE" -touch "$LOG_FILE" - -echo "๐Ÿš€ Starting Prisma Dev in background..." -node index.js >"$LOG_FILE" & -NODE_PID=$! - -# Wait for DATABASE_URL -echo "๐Ÿ”Ž Waiting for Prisma Dev to emit DATABASE_URL..." -MAX_WAIT=60 -WAITED=0 -until grep -q '^prisma+postgres://' "$LOG_FILE"; do - sleep 1 - WAITED=$((WAITED + 1)) - if [ "$WAITED" -ge "$MAX_WAIT" ]; then - echo "โŒ Timeout waiting for DATABASE_URL" - cat "$LOG_FILE" - kill "$NODE_PID" || true - exit 1 - fi -done - -DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1) -export DATABASE_URL="$DB_URL" -echo "โœ… DATABASE_URL: $DATABASE_URL" - -popd > /dev/null # Back to orm/testing-express - -# Run migrations + seed -npx prisma migrate dev --name init -npx prisma db seed - -# Run test suite -echo "๐Ÿงช Running tests..." -npm run test - -# Cleanup -echo "๐Ÿ›‘ Shutting down Prisma Dev (PID $NODE_PID)..." -kill "$NODE_PID" -wait "$NODE_PID" || true diff --git a/.github/tests/orm/typedsql/run.sh b/.github/tests/orm/typedsql/run.sh deleted file mode 100644 index 15a976e00e3b..000000000000 --- a/.github/tests/orm/typedsql/run.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -set -eu - -npm install -npx prisma migrate dev --name init -npx prisma generate --sql -npm run test diff --git a/.github/tests/postman_collections/graphql-hapi.json b/.github/tests/postman_collections/graphql-hapi.json deleted file mode 100644 index 61215675449a..000000000000 --- a/.github/tests/postman_collections/graphql-hapi.json +++ /dev/null @@ -1,564 +0,0 @@ -{ - "info": { - "_postman_id": "ce5cf911-9948-44ef-8a34-b00b90c1cba6", - "name": "prisma-examples-graphql-hapi", - "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" - }, - "item": [ - { - "name": "users", - "item": [ - { - "name": "signup", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const signupUser = {\r", - " \"data\": {\r", - " \"signupUser\": {\r", - " \"id\": 4\r", - " }\r", - " }\r", - " }\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(signupUser);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "mutation {\r\n signupUser(data: { name: \"Sarah\", email: \"sarah@prisma.io\" }) {\r\n id\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:4000/graphql", - "host": ["localhost"], - "port": "4000", - "path": ["graphql"] - } - }, - "response": [] - }, - { - "name": "createDraft", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const draft = {\r", - " \"data\": {\r", - " \"createDraft\": {\r", - " \"id\": 5,\r", - " \"viewCount\": 0,\r", - " \"published\": false,\r", - " \"author\": {\r", - " \"id\": 1,\r", - " \"name\": \"Alice\"\r", - " }\r", - " }\r", - " }\r", - "}\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(draft);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "mutation {\r\n createDraft(\r\n data: { title: \"Join the Prisma Discord\", content: \"https://pris.ly/discord\" }\r\n authorEmail: \"alice@prisma.io\"\r\n ) {\r\n id\r\n viewCount\r\n published\r\n author {\r\n id\r\n name\r\n }\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:4000/graphql", - "host": ["localhost"], - "port": "4000", - "path": ["graphql"] - } - }, - "response": [] - } - ] - }, - { - "name": "posts", - "item": [ - { - "name": "feed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const feed = {\r", - " \"data\": {\r", - " \"feed\": [\r", - " {\r", - " \"id\": 1,\r", - " \"title\": \"Join the Prisma Discord\",\r", - " \"content\": \"https://pris.ly/discord\",\r", - " \"published\": true,\r", - " \"author\": {\r", - " \"id\": 1,\r", - " \"name\": \"Alice\",\r", - " \"email\": \"alice@prisma.io\"\r", - " }\r", - " },\r", - " {\r", - " \"id\": 2,\r", - " \"title\": \"Follow Prisma on Twitter\",\r", - " \"content\": \"https://www.twitter.com/prisma\",\r", - " \"published\": true,\r", - " \"author\": {\r", - " \"id\": 2,\r", - " \"name\": \"Nilu\",\r", - " \"email\": \"nilu@prisma.io\"\r", - " }\r", - " },\r", - " {\r", - " \"id\": 3,\r", - " \"title\": \"Ask a question about Prisma on GitHub\",\r", - " \"content\": \"https://www.github.com/prisma/prisma/discussions\",\r", - " \"published\": true,\r", - " \"author\": {\r", - " \"id\": 3,\r", - " \"name\": \"Mahmoud\",\r", - " \"email\": \"mahmoud@prisma.io\"\r", - " }\r", - " }\r", - " ]\r", - " }\r", - " }\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(feed);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "query {\r\n feed {\r\n id\r\n title\r\n content\r\n published\r\n author {\r\n id\r\n name\r\n email\r\n }\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:4000/graphql", - "host": ["localhost"], - "port": "4000", - "path": ["graphql"] - } - }, - "response": [] - }, - { - "name": "feed-searchString", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const feed = {\r", - " \"data\": {\r", - " \"feed\": [\r", - " {\r", - " \"id\": 1,\r", - " \"title\": \"Join the Prisma Discord\",\r", - " \"content\": \"https://pris.ly/discord\",\r", - " \"published\": true\r", - " },\r", - " {\r", - " \"id\": 2,\r", - " \"title\": \"Follow Prisma on Twitter\",\r", - " \"content\": \"https://www.twitter.com/prisma\",\r", - " \"published\": true\r", - " },\r", - " {\r", - " \"id\": 3,\r", - " \"title\": \"Ask a question about Prisma on GitHub\",\r", - " \"content\": \"https://www.github.com/prisma/prisma/discussions\",\r", - " \"published\": true\r", - " }\r", - " ]\r", - " }\r", - "}\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(feed);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "{\r\n feed(\r\n searchString: \"Prisma\"\r\n ) {\r\n id\r\n title\r\n content\r\n published\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:4000/graphql", - "host": ["localhost"], - "port": "4000", - "path": ["graphql"] - } - }, - "response": [] - }, - { - "name": "feed-pagination_order", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const feed = {\r", - " \"data\": {\r", - " \"feed\": [\r", - " {\r", - " \"id\": 1,\r", - " \"title\": \"Join the Prisma Discord\",\r", - " \"content\": \"https://pris.ly/discord\",\r", - " \"published\": true\r", - " }\r", - " ]\r", - " }\r", - "}\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(feed);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "{\r\n feed(\r\n skip: 2\r\n take: 2\r\n orderBy: { updatedAt: desc }\r\n ) {\r\n id\r\n title\r\n content\r\n published\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:4000/graphql", - "host": ["localhost"], - "port": "4000", - "path": ["graphql"] - } - }, - "response": [] - }, - { - "name": "postById", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const post = {\r", - " \"data\": {\r", - " \"postById\": {\r", - " \"id\": 4,\r", - " \"title\": \"Prisma on YouTube\",\r", - " \"content\": \"https://pris.ly/youtube\",\r", - " \"published\": false\r", - " }\r", - " }\r", - " }\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(post);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "{\r\n postById(id: 4) {\r\n id\r\n title\r\n content\r\n published\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:4000/graphql", - "host": ["localhost"], - "port": "4000", - "path": ["graphql"] - } - }, - "response": [] - }, - { - "name": "draftsByUser", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const draftsByUser = {\r", - " \"data\": {\r", - " \"draftsByUser\": [\r", - " {\r", - " \"id\": 4,\r", - " \"title\": \"Prisma on YouTube\",\r", - " \"content\": \"https://pris.ly/youtube\",\r", - " \"published\": false,\r", - " \"author\": {\r", - " \"id\": 3,\r", - " \"name\": \"Mahmoud\",\r", - " \"email\": \"mahmoud@prisma.io\"\r", - " }\r", - " }\r", - " ]\r", - " }\r", - " }\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(draftsByUser);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "{\r\n draftsByUser(\r\n userUniqueInput: {\r\n email: \"mahmoud@prisma.io\"\r\n }\r\n ) {\r\n id\r\n title\r\n content\r\n published\r\n author {\r\n id\r\n name\r\n email\r\n }\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:4000/graphql", - "host": ["localhost"], - "port": "4000", - "path": ["graphql"] - } - }, - "response": [] - }, - { - "name": "togglePublishPost", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const post = {\r", - " \"data\": {\r", - " \"togglePublishPost\": {\r", - " \"id\": 5,\r", - " \"published\": true\r", - " }\r", - " }\r", - " }\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(post);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "mutation {\r\n togglePublishPost(id: 5) {\r\n id\r\n published\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:4000/graphql", - "host": ["localhost"], - "port": "4000", - "path": ["graphql"] - } - }, - "response": [] - }, - { - "name": "incrementPostViewCount", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const post = {\r", - " \"data\": {\r", - " \"incrementPostViewCount\": {\r", - " \"id\": 5,\r", - " \"viewCount\": 1\r", - " }\r", - " }\r", - " }\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(post);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "mutation {\r\n incrementPostViewCount(id: 5) {\r\n id\r\n viewCount\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:4000/graphql", - "host": ["localhost"], - "port": "4000", - "path": ["graphql"] - } - }, - "response": [] - }, - { - "name": "deletePost", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const post = {\r", - " \"data\": {\r", - " \"deletePost\": {\r", - " \"id\": 5\r", - " }\r", - " }\r", - " }\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(post);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "mutation {\r\n deletePost(id: 5) {\r\n id\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:4000/graphql", - "host": ["localhost"], - "port": "4000", - "path": ["graphql"] - } - }, - "response": [] - } - ] - } - ] -} diff --git a/.github/tests/postman_collections/graphql-nestjs.json b/.github/tests/postman_collections/graphql-nestjs.json deleted file mode 100644 index 8e3ffcafc078..000000000000 --- a/.github/tests/postman_collections/graphql-nestjs.json +++ /dev/null @@ -1,564 +0,0 @@ -{ - "info": { - "_postman_id": "f321f81e-ceea-46a9-82a5-16cb5119f671", - "name": "prisma-examples-graphql-nestjs", - "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" - }, - "item": [ - { - "name": "users", - "item": [ - { - "name": "signup", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const signupUser = {\r", - " \"data\": {\r", - " \"signupUser\": {\r", - " \"id\": 4\r", - " }\r", - " }\r", - " }\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(signupUser);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "mutation {\r\n signupUser(data: { name: \"Sarah\", email: \"sarah@prisma.io\" }) {\r\n id\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:3000/graphql", - "host": ["localhost"], - "port": "3000", - "path": ["graphql"] - } - }, - "response": [] - }, - { - "name": "createDraft", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const draft = {\r", - " \"data\": {\r", - " \"createDraft\": {\r", - " \"id\": 5,\r", - " \"viewCount\": 0,\r", - " \"published\": false,\r", - " \"author\": {\r", - " \"id\": 1,\r", - " \"name\": \"Alice\"\r", - " }\r", - " }\r", - " }\r", - "}\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(draft);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "mutation {\r\n createDraft(\r\n data: { title: \"Join the Prisma Discord\", content: \"https://pris.ly/discord\" }\r\n authorEmail: \"alice@prisma.io\"\r\n ) {\r\n id\r\n viewCount\r\n published\r\n author {\r\n id\r\n name\r\n }\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:3000/graphql", - "host": ["localhost"], - "port": "3000", - "path": ["graphql"] - } - }, - "response": [] - } - ] - }, - { - "name": "posts", - "item": [ - { - "name": "feed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const feed = {\r", - " \"data\": {\r", - " \"feed\": [\r", - " {\r", - " \"id\": 1,\r", - " \"title\": \"Join the Prisma Discord\",\r", - " \"content\": \"https://pris.ly/discord\",\r", - " \"published\": true,\r", - " \"author\": {\r", - " \"id\": 1,\r", - " \"name\": \"Alice\",\r", - " \"email\": \"alice@prisma.io\"\r", - " }\r", - " },\r", - " {\r", - " \"id\": 2,\r", - " \"title\": \"Follow Prisma on Twitter\",\r", - " \"content\": \"https://www.twitter.com/prisma\",\r", - " \"published\": true,\r", - " \"author\": {\r", - " \"id\": 2,\r", - " \"name\": \"Nilu\",\r", - " \"email\": \"nilu@prisma.io\"\r", - " }\r", - " },\r", - " {\r", - " \"id\": 3,\r", - " \"title\": \"Ask a question about Prisma on GitHub\",\r", - " \"content\": \"https://www.github.com/prisma/prisma/discussions\",\r", - " \"published\": true,\r", - " \"author\": {\r", - " \"id\": 3,\r", - " \"name\": \"Mahmoud\",\r", - " \"email\": \"mahmoud@prisma.io\"\r", - " }\r", - " }\r", - " ]\r", - " }\r", - " }\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(feed);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "query {\r\n feed {\r\n id\r\n title\r\n content\r\n published\r\n author {\r\n id\r\n name\r\n email\r\n }\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:3000/graphql", - "host": ["localhost"], - "port": "3000", - "path": ["graphql"] - } - }, - "response": [] - }, - { - "name": "feed-searchString", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const feed = {\r", - " \"data\": {\r", - " \"feed\": [\r", - " {\r", - " \"id\": 1,\r", - " \"title\": \"Join the Prisma Discord\",\r", - " \"content\": \"https://pris.ly/discord\",\r", - " \"published\": true\r", - " },\r", - " {\r", - " \"id\": 2,\r", - " \"title\": \"Follow Prisma on Twitter\",\r", - " \"content\": \"https://www.twitter.com/prisma\",\r", - " \"published\": true\r", - " },\r", - " {\r", - " \"id\": 3,\r", - " \"title\": \"Ask a question about Prisma on GitHub\",\r", - " \"content\": \"https://www.github.com/prisma/prisma/discussions\",\r", - " \"published\": true\r", - " }\r", - " ]\r", - " }\r", - "}\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(feed);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "{\r\n feed(\r\n searchString: \"Prisma\"\r\n ) {\r\n id\r\n title\r\n content\r\n published\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:3000/graphql", - "host": ["localhost"], - "port": "3000", - "path": ["graphql"] - } - }, - "response": [] - }, - { - "name": "feed-pagination_order", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const feed = {\r", - " \"data\": {\r", - " \"feed\": [\r", - " {\r", - " \"id\": 1,\r", - " \"title\": \"Join the Prisma Discord\",\r", - " \"content\": \"https://pris.ly/discord\",\r", - " \"published\": true\r", - " }\r", - " ]\r", - " }\r", - "}\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(feed);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "{\r\n feed(\r\n skip: 2\r\n take: 2\r\n orderBy: { updatedAt: desc }\r\n ) {\r\n id\r\n title\r\n content\r\n published\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:3000/graphql", - "host": ["localhost"], - "port": "3000", - "path": ["graphql"] - } - }, - "response": [] - }, - { - "name": "postById", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const post = {\r", - " \"data\": {\r", - " \"postById\": {\r", - " \"id\": 4,\r", - " \"title\": \"Prisma on YouTube\",\r", - " \"content\": \"https://pris.ly/youtube\",\r", - " \"published\": false\r", - " }\r", - " }\r", - " }\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(post);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "{\r\n postById(id: 4) {\r\n id\r\n title\r\n content\r\n published\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:3000/graphql", - "host": ["localhost"], - "port": "3000", - "path": ["graphql"] - } - }, - "response": [] - }, - { - "name": "draftsByUser", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const draftsByUser = {\r", - " \"data\": {\r", - " \"draftsByUser\": [\r", - " {\r", - " \"id\": 4,\r", - " \"title\": \"Prisma on YouTube\",\r", - " \"content\": \"https://pris.ly/youtube\",\r", - " \"published\": false,\r", - " \"author\": {\r", - " \"id\": 3,\r", - " \"name\": \"Mahmoud\",\r", - " \"email\": \"mahmoud@prisma.io\"\r", - " }\r", - " }\r", - " ]\r", - " }\r", - " }\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(draftsByUser);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "{\r\n draftsByUser(\r\n userUniqueInput: {\r\n email: \"mahmoud@prisma.io\"\r\n }\r\n ) {\r\n id\r\n title\r\n content\r\n published\r\n author {\r\n id\r\n name\r\n email\r\n }\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:3000/graphql", - "host": ["localhost"], - "port": "3000", - "path": ["graphql"] - } - }, - "response": [] - }, - { - "name": "togglePublishPost", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const post = {\r", - " \"data\": {\r", - " \"togglePublishPost\": {\r", - " \"id\": 5,\r", - " \"published\": true\r", - " }\r", - " }\r", - " }\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(post);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "mutation {\r\n togglePublishPost(id: 5) {\r\n id\r\n published\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:3000/graphql", - "host": ["localhost"], - "port": "3000", - "path": ["graphql"] - } - }, - "response": [] - }, - { - "name": "incrementPostViewCount", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const post = {\r", - " \"data\": {\r", - " \"incrementPostViewCount\": {\r", - " \"id\": 5,\r", - " \"viewCount\": 1\r", - " }\r", - " }\r", - " }\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(post);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "mutation {\r\n incrementPostViewCount(id: 5) {\r\n id\r\n viewCount\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:3000/graphql", - "host": ["localhost"], - "port": "3000", - "path": ["graphql"] - } - }, - "response": [] - }, - { - "name": "deletePost", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const post = {\r", - " \"data\": {\r", - " \"deletePost\": {\r", - " \"id\": 5\r", - " }\r", - " }\r", - " }\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(post);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "mutation {\r\n deletePost(id: 5) {\r\n id\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:3000/graphql", - "host": ["localhost"], - "port": "3000", - "path": ["graphql"] - } - }, - "response": [] - } - ] - } - ] -} diff --git a/.github/tests/postman_collections/graphql-typegraphql.json b/.github/tests/postman_collections/graphql-typegraphql.json deleted file mode 100644 index 4118d85840b0..000000000000 --- a/.github/tests/postman_collections/graphql-typegraphql.json +++ /dev/null @@ -1,554 +0,0 @@ -{ - "info": { - "_postman_id": "a2666eb5-efb3-45b4-8064-8b57823aed94", - "name": "prisma-examples-graphql-typegraphql", - "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" - }, - "item": [ - { - "name": "users", - "item": [ - { - "name": "signup", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const signupUser = {\r", - " \"data\": {\r", - " \"signupUser\": {\r", - " \"id\": \"4\"\r", - " }\r", - " }\r", - " }\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(signupUser);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "mutation {\r\n signupUser(data: { name: \"Sarah\", email: \"sarah@prisma.io\" }) {\r\n id\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:4000", - "host": ["localhost"], - "port": "4000" - } - }, - "response": [] - }, - { - "name": "createDraft", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const draft = {\r", - " \"data\": {\r", - " \"createDraft\": {\r", - " \"id\": \"5\",\r", - " \"viewCount\": 0,\r", - " \"published\": false,\r", - " \"author\": {\r", - " \"id\": \"1\",\r", - " \"name\": \"Alice\"\r", - " }\r", - " }\r", - " }\r", - "}\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(draft);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "mutation {\r\n createDraft(\r\n data: { title: \"Join the Prisma Discord\", content: \"https://pris.ly/discord\" }\r\n authorEmail: \"alice@prisma.io\"\r\n ) {\r\n id\r\n viewCount\r\n published\r\n author {\r\n id\r\n name\r\n }\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:4000", - "host": ["localhost"], - "port": "4000" - } - }, - "response": [] - } - ] - }, - { - "name": "posts", - "item": [ - { - "name": "feed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const feed = {\r", - " \"data\": {\r", - " \"feed\": [\r", - " {\r", - " \"id\": \"1\",\r", - " \"title\": \"Join the Prisma Discord\",\r", - " \"content\": \"https://pris.ly/discord\",\r", - " \"published\": true,\r", - " \"author\": {\r", - " \"id\": \"1\",\r", - " \"name\": \"Alice\",\r", - " \"email\": \"alice@prisma.io\"\r", - " }\r", - " },\r", - " {\r", - " \"id\": \"2\",\r", - " \"title\": \"Follow Prisma on Twitter\",\r", - " \"content\": \"https://www.twitter.com/prisma\",\r", - " \"published\": true,\r", - " \"author\": {\r", - " \"id\": \"2\",\r", - " \"name\": \"Nilu\",\r", - " \"email\": \"nilu@prisma.io\"\r", - " }\r", - " },\r", - " {\r", - " \"id\": \"3\",\r", - " \"title\": \"Ask a question about Prisma on GitHub\",\r", - " \"content\": \"https://www.github.com/prisma/prisma/discussions\",\r", - " \"published\": true,\r", - " \"author\": {\r", - " \"id\": \"3\",\r", - " \"name\": \"Mahmoud\",\r", - " \"email\": \"mahmoud@prisma.io\"\r", - " }\r", - " }\r", - " ]\r", - " }\r", - " }\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(feed);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "query {\r\n feed {\r\n id\r\n title\r\n content\r\n published\r\n author {\r\n id\r\n name\r\n email\r\n }\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:4000", - "host": ["localhost"], - "port": "4000" - } - }, - "response": [] - }, - { - "name": "feed-searchString", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const feed = {\r", - " \"data\": {\r", - " \"feed\": [\r", - " {\r", - " \"id\": \"1\",\r", - " \"title\": \"Join the Prisma Discord\",\r", - " \"content\": \"https://pris.ly/discord\",\r", - " \"published\": true\r", - " },\r", - " {\r", - " \"id\": \"2\",\r", - " \"title\": \"Follow Prisma on Twitter\",\r", - " \"content\": \"https://www.twitter.com/prisma\",\r", - " \"published\": true\r", - " },\r", - " {\r", - " \"id\": \"3\",\r", - " \"title\": \"Ask a question about Prisma on GitHub\",\r", - " \"content\": \"https://www.github.com/prisma/prisma/discussions\",\r", - " \"published\": true\r", - " }\r", - " ]\r", - " }\r", - "}\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(feed);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "{\r\n feed(\r\n searchString: \"Prisma\"\r\n ) {\r\n id\r\n title\r\n content\r\n published\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:4000", - "host": ["localhost"], - "port": "4000" - } - }, - "response": [] - }, - { - "name": "feed-pagination_order", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const feed = {\r", - " \"data\": {\r", - " \"feed\": [\r", - " {\r", - " \"id\": \"1\",\r", - " \"title\": \"Join the Prisma Discord\",\r", - " \"content\": \"https://pris.ly/discord\",\r", - " \"published\": true\r", - " }\r", - " ]\r", - " }\r", - "}\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(feed);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "{\r\n feed(\r\n skip: 2\r\n take: 2\r\n orderBy: { updatedAt: desc }\r\n ) {\r\n id\r\n title\r\n content\r\n published\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:4000", - "host": ["localhost"], - "port": "4000" - } - }, - "response": [] - }, - { - "name": "postById", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const post = {\r", - " \"data\": {\r", - " \"postById\": {\r", - " \"id\": \"4\",\r", - " \"title\": \"Prisma on YouTube\",\r", - " \"content\": \"https://pris.ly/youtube\",\r", - " \"published\": false\r", - " }\r", - " }\r", - " }\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(post);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "{\r\n postById(id: 4) {\r\n id\r\n title\r\n content\r\n published\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:4000", - "host": ["localhost"], - "port": "4000" - } - }, - "response": [] - }, - { - "name": "draftsByUser", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const draftsByUser = {\r", - " \"data\": {\r", - " \"draftsByUser\": [\r", - " {\r", - " \"id\": \"4\",\r", - " \"title\": \"Prisma on YouTube\",\r", - " \"content\": \"https://pris.ly/youtube\",\r", - " \"published\": false,\r", - " \"author\": {\r", - " \"id\": \"3\",\r", - " \"name\": \"Mahmoud\",\r", - " \"email\": \"mahmoud@prisma.io\"\r", - " }\r", - " }\r", - " ]\r", - " }\r", - " }\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(draftsByUser);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "{\r\n draftsByUser(\r\n userUniqueInput: {\r\n email: \"mahmoud@prisma.io\"\r\n }\r\n ) {\r\n id\r\n title\r\n content\r\n published\r\n author {\r\n id\r\n name\r\n email\r\n }\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:4000", - "host": ["localhost"], - "port": "4000" - } - }, - "response": [] - }, - { - "name": "togglePublishPost", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const post = {\r", - " \"data\": {\r", - " \"togglePublishPost\": {\r", - " \"id\": \"5\",\r", - " \"published\": true\r", - " }\r", - " }\r", - " }\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(post);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "mutation {\r\n togglePublishPost(id: 5) {\r\n id\r\n published\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:4000", - "host": ["localhost"], - "port": "4000" - } - }, - "response": [] - }, - { - "name": "incrementPostViewCount", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const post = {\r", - " \"data\": {\r", - " \"incrementPostViewCount\": {\r", - " \"id\": \"5\",\r", - " \"viewCount\": 1\r", - " }\r", - " }\r", - " }\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(post);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "mutation {\r\n incrementPostViewCount(id: 5) {\r\n id\r\n viewCount\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:4000", - "host": ["localhost"], - "port": "4000" - } - }, - "response": [] - }, - { - "name": "deletePost", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const post = {\r", - " \"data\": {\r", - " \"deletePost\": {\r", - " \"id\": \"5\"\r", - " }\r", - " }\r", - " }\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(post);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "mutation {\r\n deletePost(id: 5) {\r\n id\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:4000", - "host": ["localhost"], - "port": "4000" - } - }, - "response": [] - } - ] - } - ] -} diff --git a/.github/tests/postman_collections/graphql.json b/.github/tests/postman_collections/graphql.json deleted file mode 100644 index 3fc74ed20966..000000000000 --- a/.github/tests/postman_collections/graphql.json +++ /dev/null @@ -1,554 +0,0 @@ -{ - "info": { - "_postman_id": "2ebc4c96-bff0-4d4a-a0c0-d2ada09847a1", - "name": "prisma-examples-graphql", - "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" - }, - "item": [ - { - "name": "users", - "item": [ - { - "name": "signup", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const signupUser = {\r", - " \"data\": {\r", - " \"signupUser\": {\r", - " \"id\": 4\r", - " }\r", - " }\r", - " }\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(signupUser);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "mutation {\r\n signupUser(data: { name: \"Sarah\", email: \"sarah@prisma.io\" }) {\r\n id\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:4000", - "host": ["localhost"], - "port": "4000" - } - }, - "response": [] - }, - { - "name": "createDraft", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const draft = {\r", - " \"data\": {\r", - " \"createDraft\": {\r", - " \"id\": 5,\r", - " \"viewCount\": 0,\r", - " \"published\": false,\r", - " \"author\": {\r", - " \"id\": 1,\r", - " \"name\": \"Alice\"\r", - " }\r", - " }\r", - " }\r", - "}\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(draft);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "mutation {\r\n createDraft(\r\n data: { title: \"Join the Prisma Discord\", content: \"https://pris.ly/discord\" }\r\n authorEmail: \"alice@prisma.io\"\r\n ) {\r\n id\r\n viewCount\r\n published\r\n author {\r\n id\r\n name\r\n }\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:4000", - "host": ["localhost"], - "port": "4000" - } - }, - "response": [] - } - ] - }, - { - "name": "posts", - "item": [ - { - "name": "feed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const feed = {\r", - " \"data\": {\r", - " \"feed\": [\r", - " {\r", - " \"id\": 1,\r", - " \"title\": \"Join the Prisma Discord\",\r", - " \"content\": \"https://pris.ly/discord\",\r", - " \"published\": true,\r", - " \"author\": {\r", - " \"id\": 1,\r", - " \"name\": \"Alice\",\r", - " \"email\": \"alice@prisma.io\"\r", - " }\r", - " },\r", - " {\r", - " \"id\": 2,\r", - " \"title\": \"Follow Prisma on Twitter\",\r", - " \"content\": \"https://www.twitter.com/prisma\",\r", - " \"published\": true,\r", - " \"author\": {\r", - " \"id\": 2,\r", - " \"name\": \"Nilu\",\r", - " \"email\": \"nilu@prisma.io\"\r", - " }\r", - " },\r", - " {\r", - " \"id\": 3,\r", - " \"title\": \"Ask a question about Prisma on GitHub\",\r", - " \"content\": \"https://www.github.com/prisma/prisma/discussions\",\r", - " \"published\": true,\r", - " \"author\": {\r", - " \"id\": 3,\r", - " \"name\": \"Mahmoud\",\r", - " \"email\": \"mahmoud@prisma.io\"\r", - " }\r", - " }\r", - " ]\r", - " }\r", - " }\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(feed);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "query {\r\n feed {\r\n id\r\n title\r\n content\r\n published\r\n author {\r\n id\r\n name\r\n email\r\n }\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:4000", - "host": ["localhost"], - "port": "4000" - } - }, - "response": [] - }, - { - "name": "feed-searchString", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const feed = {\r", - " \"data\": {\r", - " \"feed\": [\r", - " {\r", - " \"id\": 1,\r", - " \"title\": \"Join the Prisma Discord\",\r", - " \"content\": \"https://pris.ly/discord\",\r", - " \"published\": true\r", - " },\r", - " {\r", - " \"id\": 2,\r", - " \"title\": \"Follow Prisma on Twitter\",\r", - " \"content\": \"https://www.twitter.com/prisma\",\r", - " \"published\": true\r", - " },\r", - " {\r", - " \"id\": 3,\r", - " \"title\": \"Ask a question about Prisma on GitHub\",\r", - " \"content\": \"https://www.github.com/prisma/prisma/discussions\",\r", - " \"published\": true\r", - " }\r", - " ]\r", - " }\r", - "}\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(feed);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "{\r\n feed(\r\n searchString: \"Prisma\"\r\n ) {\r\n id\r\n title\r\n content\r\n published\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:4000", - "host": ["localhost"], - "port": "4000" - } - }, - "response": [] - }, - { - "name": "feed-pagination_order", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const feed = {\r", - " \"data\": {\r", - " \"feed\": [\r", - " {\r", - " \"id\": 1,\r", - " \"title\": \"Join the Prisma Discord\",\r", - " \"content\": \"https://pris.ly/discord\",\r", - " \"published\": true\r", - " }\r", - " ]\r", - " }\r", - "}\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(feed);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "{\r\n feed(\r\n skip: 2\r\n take: 2\r\n orderBy: { updatedAt: desc }\r\n ) {\r\n id\r\n title\r\n content\r\n published\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:4000", - "host": ["localhost"], - "port": "4000" - } - }, - "response": [] - }, - { - "name": "postById", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const feed = {\r", - " \"data\": {\r", - " \"postById\": {\r", - " \"id\": 4,\r", - " \"title\": \"Prisma on YouTube\",\r", - " \"content\": \"https://pris.ly/youtube\",\r", - " \"published\": false\r", - " }\r", - " }\r", - " }\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(feed);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "{\r\n postById(id: 4 ) {\r\n id\r\n title\r\n content\r\n published\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:4000", - "host": ["localhost"], - "port": "4000" - } - }, - "response": [] - }, - { - "name": "draftsByUser", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const draftsByUser = {\r", - " \"data\": {\r", - " \"draftsByUser\": [\r", - " {\r", - " \"id\": 4,\r", - " \"title\": \"Prisma on YouTube\",\r", - " \"content\": \"https://pris.ly/youtube\",\r", - " \"published\": false,\r", - " \"author\": {\r", - " \"id\": 3,\r", - " \"name\": \"Mahmoud\",\r", - " \"email\": \"mahmoud@prisma.io\"\r", - " }\r", - " }\r", - " ]\r", - " }\r", - " }\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(draftsByUser);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "{\r\n draftsByUser(\r\n userUniqueInput: {\r\n email: \"mahmoud@prisma.io\"\r\n }\r\n ) {\r\n id\r\n title\r\n content\r\n published\r\n author {\r\n id\r\n name\r\n email\r\n }\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:4000", - "host": ["localhost"], - "port": "4000" - } - }, - "response": [] - }, - { - "name": "togglePublishPost", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const post = {\r", - " \"data\": {\r", - " \"togglePublishPost\": {\r", - " \"id\": 5,\r", - " \"published\": true\r", - " }\r", - " }\r", - " }\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(post);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "mutation {\r\n togglePublishPost(id: 5) {\r\n id\r\n published\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:4000", - "host": ["localhost"], - "port": "4000" - } - }, - "response": [] - }, - { - "name": "incrementPostViewCount", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const post = {\r", - " \"data\": {\r", - " \"incrementPostViewCount\": {\r", - " \"id\": 5,\r", - " \"viewCount\": 1\r", - " }\r", - " }\r", - " }\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(post);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "mutation {\r\n incrementPostViewCount(id: 5) {\r\n id\r\n viewCount\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:4000", - "host": ["localhost"], - "port": "4000" - } - }, - "response": [] - }, - { - "name": "deletePost", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test(\"Status code is 200\", function () {\r", - " pm.response.to.have.status(200);\r", - "});\r", - "\r", - "pm.test(\"Response body is valid\", function () {\r", - " const post = {\r", - " \"data\": {\r", - " \"deletePost\": {\r", - " \"id\": 5\r", - " }\r", - " }\r", - " }\r", - " \r", - " const jsonData = pm.response.json();\r", - " pm.expect(jsonData).to.eql(post);\r", - "});" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "graphql", - "graphql": { - "query": "mutation {\r\n deletePost(id: 5) {\r\n id\r\n }\r\n}", - "variables": "" - } - }, - "url": { - "raw": "localhost:4000", - "host": ["localhost"], - "port": "4000" - } - }, - "response": [] - } - ] - } - ] -} diff --git a/.github/tests/postman_collections/rest.json b/.github/tests/postman_collections/rest.json deleted file mode 100644 index e6166330c61a..000000000000 --- a/.github/tests/postman_collections/rest.json +++ /dev/null @@ -1,473 +0,0 @@ -{ - "info": { - "_postman_id": "0f8cc0ab-4554-4537-b23f-fa62e80a6302", - "name": "prisma-examples-rest", - "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" - }, - "item": [ - { - "name": "users", - "item": [ - { - "name": "allUsers", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test('Status code is 200', () => {\r", - " pm.expect(pm.response.code).to.be.oneOf([200,201])\r", - "})\r", - "\r", - "pm.test('Response body is valid', function () {\r", - " const allUsers = [\r", - " {\r", - " \"id\": 1,\r", - " \"email\": \"alice@prisma.io\",\r", - " \"name\": \"Alice\"\r", - " },\r", - " {\r", - " \"id\": 2,\r", - " \"email\": \"nilu@prisma.io\",\r", - " \"name\": \"Nilu\"\r", - " },\r", - " {\r", - " \"id\": 3,\r", - " \"email\": \"mahmoud@prisma.io\",\r", - " \"name\": \"Mahmoud\"\r", - " }\r", - " ]\r", - " \r", - " const jsonData = pm.response.json()\r", - " pm.expect(jsonData).to.eql(allUsers)\r", - "})\r", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3000/users", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3000", - "path": [ - "users" - ] - } - }, - "response": [] - }, - { - "name": "getUserDrafts", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test('Status code is 200', () => {\r", - " pm.expect(pm.response.code).to.be.oneOf([200,201])\r", - "})\r", - "\r", - "pm.test('Response body is valid', function () {\r", - " const jsonData = pm.response.json()\r", - " pm.expect(jsonData[0].id).to.eql(4)\r", - " pm.expect(jsonData[0].title).to.eql(\"Prisma on YouTube\")\r", - " pm.expect(jsonData[0].content).to.eql(\"https://pris.ly/youtube\")\r", - " pm.expect(jsonData[0].published).to.eql(false)\r", - " pm.expect(jsonData[0].viewCount).to.eql(0)\r", - " pm.expect(jsonData[0].authorId).to.eql(3)\r", - "})\r", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3000/user/3/drafts", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3000", - "path": [ - "user", - "3", - "drafts" - ] - } - }, - "response": [] - }, - { - "name": "signup", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test('Status code is 200', () => {\r", - " pm.expect(pm.response.code).to.be.oneOf([200,201])\r", - "})\r", - "\r", - "pm.test('Response body is valid', function () {\r", - " var jsonData = pm.response.json()\r", - " pm.expect(jsonData.id).to.eql(4)\r", - " pm.expect(jsonData.name).to.eql(\"Alex\")\r", - " pm.expect(jsonData.email).to.eql(\"alex@prisma.io\")\r", - "})\r", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\r\n\t\"name\": \"Alex\",\r\n\t\"email\": \"alex@prisma.io\",\r\n\t\"posts\":[\r\n\t\t{\r\n\t\t\t\"title\": \"Prisma and APIs\",\r\n \"content\": \"This works pretty smoothly with any type of API\"\r\n\t\t}\r\n\t]\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:3000/signup", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3000", - "path": [ - "signup" - ] - } - }, - "response": [] - } - ], - "auth": { - "type": "noauth" - }, - "event": [ - { - "listen": "prerequest", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - }, - { - "listen": "test", - "script": { - "type": "text/javascript", - "exec": [ - "" - ] - } - } - ] - }, - { - "name": "posts", - "item": [ - { - "name": "feed", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test('Status code is 200', () => {\r", - " pm.expect(pm.response.code).to.be.oneOf([200,201])\r", - "})\r", - "\r", - "pm.test('Response body is valid', function () {\r", - " const jsonData = pm.response.json()\r", - " pm.expect(jsonData[0].id).to.eql(1)\r", - " pm.expect(jsonData[0].title).to.eql(\"Join the Prisma Discord\")\r", - " pm.expect(jsonData[0].content).to.eql(\"https://pris.ly/discord\")\r", - " pm.expect(jsonData[0].published).to.eql(true)\r", - " pm.expect(jsonData[0].viewCount).to.eql(0)\r", - " pm.expect(jsonData[0].authorId).to.eql(1)\r", - "})" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3000/feed?searchString=discord", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3000", - "path": [ - "feed" - ], - "query": [ - { - "key": "searchString", - "value": "discord" - } - ] - } - }, - "response": [] - }, - { - "name": "getPostById", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test('Status code is 200', () => {\r", - " pm.expect(pm.response.code).to.be.oneOf([200,201])\r", - "})\r", - "\r", - "pm.test('Response body is valid', function () { \r", - " const jsonData = pm.response.json()\r", - " pm.expect(jsonData.id).to.eql(3)\r", - " pm.expect(jsonData.title).to.eql(\"Ask a question about Prisma on GitHub\")\r", - " pm.expect(jsonData.content).to.eql(\"https://www.github.com/prisma/prisma/discussions\")\r", - " pm.expect(jsonData.published).to.eql(true)\r", - " pm.expect(jsonData.authorId).to.eql(3)\r", - "})" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "GET", - "header": [], - "url": { - "raw": "http://localhost:3000/post/3", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3000", - "path": [ - "post", - "3" - ] - } - }, - "response": [] - }, - { - "name": "togglePublish", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test('Status code is 200', () => {\r", - " pm.expect(pm.response.code).to.be.oneOf([200,201])\r", - "})\r", - "\r", - "pm.test('Response body is valid', function () {\r", - " const jsonData = pm.response.json()\r", - " pm.expect(jsonData.id).to.eql(4)\r", - " pm.expect(jsonData.title).to.eql(\"Prisma on YouTube\")\r", - " pm.expect(jsonData.content).to.eql(\"https://pris.ly/youtube\")\r", - " pm.expect(jsonData.published).to.eql(true)\r", - " pm.expect(jsonData.viewCount).to.eql(0)\r", - " pm.expect(jsonData.authorId).to.eql(3)\r", - "})\r", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "PUT", - "header": [], - "url": { - "raw": "http://localhost:3000/publish/4", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3000", - "path": [ - "publish", - "4" - ] - } - }, - "response": [] - }, - { - "name": "incrementPostViewCount", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test('Status code is 200', () => {\r", - " pm.expect(pm.response.code).to.be.oneOf([200,201])\r", - "})\r", - "\r", - "pm.test('Response body is valid', function () {\r", - " const jsonData = pm.response.json()\r", - " pm.expect(jsonData.id).to.eql(4)\r", - " pm.expect(jsonData.title).to.eql(\"Prisma on YouTube\")\r", - " pm.expect(jsonData.content).to.eql(\"https://pris.ly/youtube\")\r", - " pm.expect(jsonData.published).to.eql(true)\r", - " pm.expect(jsonData.viewCount).to.eql(1)\r", - " pm.expect(jsonData.authorId).to.eql(3)\r", - "})\r", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "PUT", - "header": [], - "url": { - "raw": "http://localhost:3000/post/4/views", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3000", - "path": [ - "post", - "4", - "views" - ] - } - }, - "response": [] - }, - { - "name": "createDraft", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test('Status code is 200', () => {\r", - " pm.expect(pm.response.code).to.be.oneOf([200,201])\r", - "})\r", - "\r", - "pm.test('Response body is valid', function () {\r", - " const jsonData = pm.response.json()\r", - " pm.expect(jsonData.id).to.eql(6)\r", - " pm.expect(jsonData.title).to.eql(\"Postman and Newman - Testing APIs\")\r", - " pm.expect(jsonData.content).to.eql(null)\r", - " pm.expect(jsonData.published).to.eql(false)\r", - " pm.expect(jsonData.viewCount).to.eql(0)\r", - " pm.expect(jsonData.authorId).to.eql(2)\r", - "})\r", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "POST", - "header": [], - "body": { - "mode": "raw", - "raw": "{\r\n\t\"title\":\"Postman and Newman - Testing APIs\",\r\n\t\"authorEmail\":\"nilu@prisma.io\"\r\n}", - "options": { - "raw": { - "language": "json" - } - } - }, - "url": { - "raw": "http://localhost:3000/post", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3000", - "path": [ - "post" - ] - } - }, - "response": [] - }, - { - "name": "deletePost", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "pm.test('Status code is 200', () => {\r", - " pm.expect(pm.response.code).to.be.oneOf([200,201])\r", - "})\r", - "\r", - "pm.test('Response body is valid', function () {\r", - " const jsonData = pm.response.json()\r", - " pm.expect(jsonData.id).to.eql(6)\r", - " pm.expect(jsonData.title).to.eql(\"Postman and Newman - Testing APIs\")\r", - " pm.expect(jsonData.content).to.eql(null)\r", - " pm.expect(jsonData.published).to.eql(false)\r", - " pm.expect(jsonData.viewCount).to.eql(0)\r", - " pm.expect(jsonData.authorId).to.eql(2)\r", - "})\r", - "" - ], - "type": "text/javascript" - } - } - ], - "request": { - "method": "DELETE", - "header": [], - "url": { - "raw": "http://localhost:3000/post/6", - "protocol": "http", - "host": [ - "localhost" - ], - "port": "3000", - "path": [ - "post", - "6" - ] - } - }, - "response": [] - } - ] - } - ], - "variable": [ - { - "key": "allUsers", - "value": "const users = [\r\n {\r\n \"id\": 1,\r\n \"email\": \"alice@prisma.io\",\r\n \"name\": \"Alice\"\r\n },\r\n {\r\n \"id\": 2,\r\n \"email\": \"nilu@prisma.io\",\r\n \"name\": \"Nilu\"\r\n },\r\n {\r\n \"id\": 3,\r\n \"email\": \"mahmoud@prisma.io\",\r\n \"name\": \"Mahmoud\"\r\n },\r\n {\r\n \"id\": 4,\r\n \"email\": \"alex@prisma.io\",\r\n \"name\": \"Alex\"\r\n }\r\n]" - } - ] -} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3b7fe7ec4077..aea0b414c249 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -3,6 +3,10 @@ on: push: paths: - orm/** + - databases/** + - tests/** + - package.json + - vitest.config.ts branches: - latest pull_request: @@ -11,65 +15,38 @@ env: CI: 1 PRISMA_TELEMETRY_INFORMATION: 'prisma-examples test.yaml' SLACK_WEBHOOK_URL_FAILING: ${{ secrets.SLACK_WEBHOOK_URL_FAILING }} - SKIP_PRISMA_VERSION_CHECK: true # Skip Prisma version check in typegraphl-prisma (https://github.com/MichalLytek/typegraphql-prisma/blob/fc7cfa756a60dd6671a902c38f00ee74698a681a/Readme.md#lifting-prisma-version-restriction) + SKIP_PRISMA_VERSION_CHECK: true jobs: - projects-matrix: + # Generate test matrix from test files + test-matrix: if: github.repository_owner == 'prisma' runs-on: ubuntu-latest outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} steps: - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: '22.21.1' - - - name: install deps - run: cd .github/scripts && yarn install - - - name: get list of projects as json array - id: set-matrix - run: node .github/scripts/get-packages.js - test-prisma-postgres: - if: github.repository_owner == 'prisma' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Run prisma-postgres test - working-directory: .github/tests/databases/prisma-postgres + - id: set-matrix run: | - chmod +x run.sh - ./run.sh + # Find all test files and create matrix JSON + tests=$(find tests -name "*.test.ts" | sed 's|tests/||' | sed 's|\.test\.ts||' | jq -R -s -c 'split("\n") | map(select(length > 0))') + echo "matrix={\"test\":$tests}" >> $GITHUB_OUTPUT + test: - needs: projects-matrix + needs: test-matrix if: github.repository_owner == 'prisma' runs-on: ubuntu-latest - env: - PPG_TEST_DATABASE_URL: ${{ secrets.PPG_TEST_DATABASE_URL }} strategy: fail-fast: false - matrix: ${{fromJson(needs.projects-matrix.outputs.matrix)}} - services: - postgres: - image: postgis/postgis:14-3.1-alpine - env: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: password - POSTGRES_DB: testing - # Set health checks to wait until postgres has started - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - ports: - - '5432:5432' + matrix: ${{ fromJson(needs.test-matrix.outputs.matrix) }} steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: '22.21.1' + node-version: '22' + + - name: Install root dependencies + run: npm install - - name: test - run: bash .github/scripts/test-all.sh ./${{ matrix.path }}/package.json + - name: Run test - ${{ matrix.test }} + run: npx vitest run tests/${{ matrix.test }}.test.ts diff --git a/.gitignore b/.gitignore index 1fd2aa236b22..c17462a4ae6b 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ databases/**/migrations/ orm/**/package-lock.json misc/**/package-lock.json experimental/**/package-lock.json +.output/ databases/**/package-lock.json experimental/**/*.db diff --git a/.nvmrc b/.nvmrc index a77793ecc520..8fdd954df983 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -lts/hydrogen +22 \ No newline at end of file diff --git a/accelerate/remix-starter/prisma.config.ts b/accelerate/remix-starter/prisma.config.ts index 625c2bab069f..b82cfcc4ff25 100644 --- a/accelerate/remix-starter/prisma.config.ts +++ b/accelerate/remix-starter/prisma.config.ts @@ -2,12 +2,12 @@ import "dotenv/config"; import { defineConfig, env } from "prisma/config"; export default defineConfig({ - schema: "prisma/schema.prisma", - migrations: { - path: "prisma/migrations", - seed: "tsx ./prisma/seed.ts", - }, - datasource: { - url: env("DATABASE_URL"), - }, + schema: "prisma/schema.prisma", + migrations: { + path: "prisma/migrations", + seed: "tsx ./prisma/seed.ts", + }, + datasource: { + url: env("DATABASE_URL"), + }, }); diff --git a/databases/mongodb/prisma/schema.prisma b/databases/mongodb/prisma/schema.prisma index 8f827b9213a4..6a7ee01b5a53 100644 --- a/databases/mongodb/prisma/schema.prisma +++ b/databases/mongodb/prisma/schema.prisma @@ -1,6 +1,7 @@ // We want to connect to the MongoDB datasource datasource db { provider = "mongodb" + url = env("DATABASE_URL") } generator client { diff --git a/generator-prisma-client/basic-typedsql/src/index.ts b/generator-prisma-client/basic-typedsql/src/index.ts index 1b7aa0e13db5..d2f358b1f640 100644 --- a/generator-prisma-client/basic-typedsql/src/index.ts +++ b/generator-prisma-client/basic-typedsql/src/index.ts @@ -1,9 +1,9 @@ import { PrismaClient } from './generated/prisma/client' -import { PrismaBetterSQLite3 } from '@prisma/adapter-better-sqlite3'; +import { PrismaBetterSqlite3 } from '@prisma/adapter-better-sqlite3'; import { conversionByVariant, filterTrackingEvents, getTrackingEvents } from './generated/prisma/sql' async function main() { - const adapter = new PrismaBetterSQLite3({ url: 'file:./prisma/dev.db' }) + const adapter = new PrismaBetterSqlite3({ url: 'file:./prisma/dev.db' }) const prisma = new PrismaClient({ adapter }) const stats = await prisma.$queryRawTyped(conversionByVariant()) diff --git a/orm/ai-sdk-nextjs/package.json b/orm/ai-sdk-nextjs/package.json index 63f7a0eabfbd..15f05af4a3ff 100644 --- a/orm/ai-sdk-nextjs/package.json +++ b/orm/ai-sdk-nextjs/package.json @@ -11,8 +11,8 @@ "dependencies": { "@ai-sdk/openai": "2.0.24", "@ai-sdk/react": "2.0.34", - "@prisma/adapter-pg": "6.20.0-integration-next.10", - "@prisma/client": "6.20.0-integration-next.10", + "@prisma/adapter-pg": "7.2.0", + "@prisma/client": "7.2.0", "ai": "5.0.34", "next": "15.4.10", "react": "19.2.3", @@ -25,7 +25,7 @@ "@types/node": "20.19.24", "@types/react": "^19", "@types/react-dom": "^19", - "prisma": "6.20.0-integration-next.10", + "prisma": "7.2.0", "tailwindcss": "4.1.13", "tsx": "4.20.6", "typescript": "5.9.2", diff --git a/orm/graphql/lib/pothos-prisma-types.ts b/orm/graphql/lib/pothos-prisma-types.ts index 2bc5a3a0f32a..4edd7d710f11 100644 --- a/orm/graphql/lib/pothos-prisma-types.ts +++ b/orm/graphql/lib/pothos-prisma-types.ts @@ -1,46 +1,50 @@ /* eslint-disable */ -import type { Prisma, User, Post } from "../prisma/generated/client"; -import type { PothosPrismaDatamodel } from "@pothos/plugin-prisma"; +import type { Prisma, User, Post } from '../prisma/generated/client' +import type { PothosPrismaDatamodel } from '@pothos/plugin-prisma' export default interface PrismaTypes { - User: { - Name: "User"; - Shape: User; - Include: Prisma.UserInclude; - Select: Prisma.UserSelect; - OrderBy: Prisma.UserOrderByWithRelationInput; - WhereUnique: Prisma.UserWhereUniqueInput; - Where: Prisma.UserWhereInput; - Create: {}; - Update: {}; - RelationName: "posts"; - ListRelations: "posts"; - Relations: { - posts: { - Shape: Post[]; - Name: "Post"; - Nullable: false; - }; - }; - }; - Post: { - Name: "Post"; - Shape: Post; - Include: Prisma.PostInclude; - Select: Prisma.PostSelect; - OrderBy: Prisma.PostOrderByWithRelationInput; - WhereUnique: Prisma.PostWhereUniqueInput; - Where: Prisma.PostWhereInput; - Create: {}; - Update: {}; - RelationName: "author"; - ListRelations: never; - Relations: { - author: { - Shape: User | null; - Name: "User"; - Nullable: true; - }; - }; - }; + User: { + Name: 'User' + Shape: User + Include: Prisma.UserInclude + Select: Prisma.UserSelect + OrderBy: Prisma.UserOrderByWithRelationInput + WhereUnique: Prisma.UserWhereUniqueInput + Where: Prisma.UserWhereInput + Create: {} + Update: {} + RelationName: 'posts' + ListRelations: 'posts' + Relations: { + posts: { + Shape: Post[] + Name: 'Post' + Nullable: false + } + } + } + Post: { + Name: 'Post' + Shape: Post + Include: Prisma.PostInclude + Select: Prisma.PostSelect + OrderBy: Prisma.PostOrderByWithRelationInput + WhereUnique: Prisma.PostWhereUniqueInput + Where: Prisma.PostWhereInput + Create: {} + Update: {} + RelationName: 'author' + ListRelations: never + Relations: { + author: { + Shape: User | null + Name: 'User' + Nullable: true + } + } + } +} +export function getDatamodel(): PothosPrismaDatamodel { + return JSON.parse( + '{"datamodel":{"models":{"User":{"fields":[{"type":"Int","kind":"scalar","name":"id","isRequired":true,"isList":false,"hasDefaultValue":true,"isUnique":false,"isId":true,"isUpdatedAt":false},{"type":"String","kind":"scalar","name":"email","isRequired":true,"isList":false,"hasDefaultValue":false,"isUnique":true,"isId":false,"isUpdatedAt":false},{"type":"String","kind":"scalar","name":"name","isRequired":false,"isList":false,"hasDefaultValue":false,"isUnique":false,"isId":false,"isUpdatedAt":false},{"type":"Post","kind":"object","name":"posts","isRequired":true,"isList":true,"hasDefaultValue":false,"isUnique":false,"isId":false,"relationName":"PostToUser","relationFromFields":[],"isUpdatedAt":false}],"primaryKey":null,"uniqueIndexes":[]},"Post":{"fields":[{"type":"Int","kind":"scalar","name":"id","isRequired":true,"isList":false,"hasDefaultValue":true,"isUnique":false,"isId":true,"isUpdatedAt":false},{"type":"DateTime","kind":"scalar","name":"createdAt","isRequired":true,"isList":false,"hasDefaultValue":true,"isUnique":false,"isId":false,"isUpdatedAt":false},{"type":"DateTime","kind":"scalar","name":"updatedAt","isRequired":true,"isList":false,"hasDefaultValue":false,"isUnique":false,"isId":false,"isUpdatedAt":true},{"type":"String","kind":"scalar","name":"title","isRequired":true,"isList":false,"hasDefaultValue":false,"isUnique":false,"isId":false,"isUpdatedAt":false},{"type":"String","kind":"scalar","name":"content","isRequired":false,"isList":false,"hasDefaultValue":false,"isUnique":false,"isId":false,"isUpdatedAt":false},{"type":"Boolean","kind":"scalar","name":"published","isRequired":true,"isList":false,"hasDefaultValue":true,"isUnique":false,"isId":false,"isUpdatedAt":false},{"type":"Int","kind":"scalar","name":"viewCount","isRequired":true,"isList":false,"hasDefaultValue":true,"isUnique":false,"isId":false,"isUpdatedAt":false},{"type":"User","kind":"object","name":"author","isRequired":false,"isList":false,"hasDefaultValue":false,"isUnique":false,"isId":false,"relationName":"PostToUser","relationFromFields":["authorId"],"isUpdatedAt":false},{"type":"Int","kind":"scalar","name":"authorId","isRequired":false,"isList":false,"hasDefaultValue":false,"isUnique":false,"isId":false,"isUpdatedAt":false}],"primaryKey":null,"uniqueIndexes":[]}}}}', + ) } -export function getDatamodel(): PothosPrismaDatamodel { return JSON.parse("{\"datamodel\":{\"models\":{\"User\":{\"fields\":[{\"type\":\"Int\",\"kind\":\"scalar\",\"name\":\"id\",\"isRequired\":true,\"isList\":false,\"hasDefaultValue\":true,\"isUnique\":false,\"isId\":true,\"isUpdatedAt\":false},{\"type\":\"String\",\"kind\":\"scalar\",\"name\":\"email\",\"isRequired\":true,\"isList\":false,\"hasDefaultValue\":false,\"isUnique\":true,\"isId\":false,\"isUpdatedAt\":false},{\"type\":\"String\",\"kind\":\"scalar\",\"name\":\"name\",\"isRequired\":false,\"isList\":false,\"hasDefaultValue\":false,\"isUnique\":false,\"isId\":false,\"isUpdatedAt\":false},{\"type\":\"Post\",\"kind\":\"object\",\"name\":\"posts\",\"isRequired\":true,\"isList\":true,\"hasDefaultValue\":false,\"isUnique\":false,\"isId\":false,\"relationName\":\"PostToUser\",\"relationFromFields\":[],\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueIndexes\":[]},\"Post\":{\"fields\":[{\"type\":\"Int\",\"kind\":\"scalar\",\"name\":\"id\",\"isRequired\":true,\"isList\":false,\"hasDefaultValue\":true,\"isUnique\":false,\"isId\":true,\"isUpdatedAt\":false},{\"type\":\"DateTime\",\"kind\":\"scalar\",\"name\":\"createdAt\",\"isRequired\":true,\"isList\":false,\"hasDefaultValue\":true,\"isUnique\":false,\"isId\":false,\"isUpdatedAt\":false},{\"type\":\"DateTime\",\"kind\":\"scalar\",\"name\":\"updatedAt\",\"isRequired\":true,\"isList\":false,\"hasDefaultValue\":false,\"isUnique\":false,\"isId\":false,\"isUpdatedAt\":true},{\"type\":\"String\",\"kind\":\"scalar\",\"name\":\"title\",\"isRequired\":true,\"isList\":false,\"hasDefaultValue\":false,\"isUnique\":false,\"isId\":false,\"isUpdatedAt\":false},{\"type\":\"String\",\"kind\":\"scalar\",\"name\":\"content\",\"isRequired\":false,\"isList\":false,\"hasDefaultValue\":false,\"isUnique\":false,\"isId\":false,\"isUpdatedAt\":false},{\"type\":\"Boolean\",\"kind\":\"scalar\",\"name\":\"published\",\"isRequired\":true,\"isList\":false,\"hasDefaultValue\":true,\"isUnique\":false,\"isId\":false,\"isUpdatedAt\":false},{\"type\":\"Int\",\"kind\":\"scalar\",\"name\":\"viewCount\",\"isRequired\":true,\"isList\":false,\"hasDefaultValue\":true,\"isUnique\":false,\"isId\":false,\"isUpdatedAt\":false},{\"type\":\"User\",\"kind\":\"object\",\"name\":\"author\",\"isRequired\":false,\"isList\":false,\"hasDefaultValue\":false,\"isUnique\":false,\"isId\":false,\"relationName\":\"PostToUser\",\"relationFromFields\":[\"authorId\"],\"isUpdatedAt\":false},{\"type\":\"Int\",\"kind\":\"scalar\",\"name\":\"authorId\",\"isRequired\":false,\"isList\":false,\"hasDefaultValue\":false,\"isUnique\":false,\"isId\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueIndexes\":[]}}}}"); } \ No newline at end of file diff --git a/orm/hapi-graphql/schema.graphql b/orm/hapi-graphql/schema.graphql index 8b5741e6c9bf..db427ec89ccf 100644 --- a/orm/hapi-graphql/schema.graphql +++ b/orm/hapi-graphql/schema.graphql @@ -63,4 +63,4 @@ input UserCreateInput { input UserUniqueInput { email: String id: Int -} +} \ No newline at end of file diff --git a/orm/hapi-graphql/src/generated/nexus.ts b/orm/hapi-graphql/src/generated/nexus.ts index 31019e969835..254408f9252d 100644 --- a/orm/hapi-graphql/src/generated/nexus.ts +++ b/orm/hapi-graphql/src/generated/nexus.ts @@ -3,17 +3,15 @@ * Do not make changes to this file directly */ -import { Context } from './../context' -import { core } from 'nexus' +import type * as prisma from "./../../prisma/generated/client" +import type { Context } from "./../context" +import type { core } from "nexus" declare global { interface NexusGenCustomInputMethods { /** * A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar. */ - date( - fieldName: FieldName, - opts?: core.CommonInputFieldConfig, - ): void // "DateTime"; + date(fieldName: FieldName, opts?: core.CommonInputFieldConfig): void // "DateTime"; } } declare global { @@ -21,42 +19,36 @@ declare global { /** * A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar. */ - date( - fieldName: FieldName, - ...opts: core.ScalarOutSpread - ): void // "DateTime"; + date(fieldName: FieldName, ...opts: core.ScalarOutSpread): void // "DateTime"; } } + declare global { interface NexusGen extends NexusGenTypes {} } export interface NexusGenInputs { - PostCreateInput: { - // input type - content?: string | null // String - title: string // String! + PostCreateInput: { // input type + content?: string | null; // String + title: string; // String! } - PostOrderByUpdatedAtInput: { - // input type - updatedAt: NexusGenEnums['SortOrder'] // SortOrder! + PostOrderByUpdatedAtInput: { // input type + updatedAt: NexusGenEnums['SortOrder']; // SortOrder! } - UserCreateInput: { - // input type - email: string // String! - name?: string | null // String - posts?: NexusGenInputs['PostCreateInput'][] | null // [PostCreateInput!] + UserCreateInput: { // input type + email: string; // String! + name?: string | null; // String + posts?: NexusGenInputs['PostCreateInput'][] | null; // [PostCreateInput!] } - UserUniqueInput: { - // input type - email?: string | null // String - id?: number | null // Int + UserUniqueInput: { // input type + email?: string | null; // String + id?: number | null; // Int } } export interface NexusGenEnums { - SortOrder: 'asc' | 'desc' + SortOrder: "asc" | "desc" } export interface NexusGenScalars { @@ -69,83 +61,63 @@ export interface NexusGenScalars { } export interface NexusGenObjects { - Mutation: {} - Post: { - // root type - content?: string | null // String - createdAt: NexusGenScalars['DateTime'] // DateTime! - id: number // Int! - published: boolean // Boolean! - title: string // String! - updatedAt: NexusGenScalars['DateTime'] // DateTime! - viewCount: number // Int! - } - Query: {} - User: { - // root type - email: string // String! - id: number // Int! - name?: string | null // String - } + Mutation: {}; + Post: prisma.Post; + Query: {}; + User: prisma.User; } -export interface NexusGenInterfaces {} +export interface NexusGenInterfaces { +} -export interface NexusGenUnions {} +export interface NexusGenUnions { +} export type NexusGenRootTypes = NexusGenObjects -export type NexusGenAllTypes = NexusGenRootTypes & - NexusGenScalars & - NexusGenEnums +export type NexusGenAllTypes = NexusGenRootTypes & NexusGenScalars & NexusGenEnums export interface NexusGenFieldTypes { - Mutation: { - // field return type - createDraft: NexusGenRootTypes['Post'] | null // Post - deletePost: NexusGenRootTypes['Post'] | null // Post - incrementPostViewCount: NexusGenRootTypes['Post'] | null // Post - signupUser: NexusGenRootTypes['User'] // User! - togglePublishPost: NexusGenRootTypes['Post'] | null // Post - } - Post: { - // field return type - author: NexusGenRootTypes['User'] | null // User - content: string | null // String - createdAt: NexusGenScalars['DateTime'] // DateTime! - id: number // Int! - published: boolean // Boolean! - title: string // String! - updatedAt: NexusGenScalars['DateTime'] // DateTime! - viewCount: number // Int! - } - Query: { - // field return type - allUsers: NexusGenRootTypes['User'][] // [User!]! - draftsByUser: Array | null // [Post] - feed: NexusGenRootTypes['Post'][] // [Post!]! - postById: NexusGenRootTypes['Post'] | null // Post - } - User: { - // field return type - email: string // String! - id: number // Int! - name: string | null // String - posts: NexusGenRootTypes['Post'][] // [Post!]! + Mutation: { // field return type + createDraft: NexusGenRootTypes['Post'] | null; // Post + deletePost: NexusGenRootTypes['Post'] | null; // Post + incrementPostViewCount: NexusGenRootTypes['Post'] | null; // Post + signupUser: NexusGenRootTypes['User']; // User! + togglePublishPost: NexusGenRootTypes['Post'] | null; // Post + } + Post: { // field return type + author: NexusGenRootTypes['User'] | null; // User + content: string | null; // String + createdAt: NexusGenScalars['DateTime']; // DateTime! + id: number; // Int! + published: boolean; // Boolean! + title: string; // String! + updatedAt: NexusGenScalars['DateTime']; // DateTime! + viewCount: number; // Int! + } + Query: { // field return type + allUsers: NexusGenRootTypes['User'][]; // [User!]! + draftsByUser: Array | null; // [Post] + feed: NexusGenRootTypes['Post'][]; // [Post!]! + postById: NexusGenRootTypes['Post'] | null; // Post + } + User: { // field return type + email: string; // String! + id: number; // Int! + name: string | null; // String + posts: NexusGenRootTypes['Post'][]; // [Post!]! } } export interface NexusGenFieldTypeNames { - Mutation: { - // field return type name + Mutation: { // field return type name createDraft: 'Post' deletePost: 'Post' incrementPostViewCount: 'Post' signupUser: 'User' togglePublishPost: 'Post' } - Post: { - // field return type name + Post: { // field return type name author: 'User' content: 'String' createdAt: 'DateTime' @@ -155,15 +127,13 @@ export interface NexusGenFieldTypeNames { updatedAt: 'DateTime' viewCount: 'Int' } - Query: { - // field return type name + Query: { // field return type name allUsers: 'User' draftsByUser: 'Post' feed: 'Post' postById: 'Post' } - User: { - // field return type name + User: { // field return type name email: 'String' id: 'Int' name: 'String' @@ -173,66 +143,60 @@ export interface NexusGenFieldTypeNames { export interface NexusGenArgTypes { Mutation: { - createDraft: { - // args - authorEmail: string // String! - data: NexusGenInputs['PostCreateInput'] // PostCreateInput! + createDraft: { // args + authorEmail: string; // String! + data: NexusGenInputs['PostCreateInput']; // PostCreateInput! } - deletePost: { - // args - id: number // Int! + deletePost: { // args + id: number; // Int! } - incrementPostViewCount: { - // args - id: number // Int! + incrementPostViewCount: { // args + id: number; // Int! } - signupUser: { - // args - data: NexusGenInputs['UserCreateInput'] // UserCreateInput! + signupUser: { // args + data: NexusGenInputs['UserCreateInput']; // UserCreateInput! } - togglePublishPost: { - // args - id: number // Int! + togglePublishPost: { // args + id: number; // Int! } } Query: { - draftsByUser: { - // args - userUniqueInput: NexusGenInputs['UserUniqueInput'] // UserUniqueInput! + draftsByUser: { // args + userUniqueInput: NexusGenInputs['UserUniqueInput']; // UserUniqueInput! } - feed: { - // args - orderBy?: NexusGenInputs['PostOrderByUpdatedAtInput'] | null // PostOrderByUpdatedAtInput - searchString?: string | null // String - skip?: number | null // Int - take?: number | null // Int + feed: { // args + orderBy?: NexusGenInputs['PostOrderByUpdatedAtInput'] | null; // PostOrderByUpdatedAtInput + searchString?: string | null; // String + skip?: number | null; // Int + take?: number | null; // Int } - postById: { - // args - id?: number | null // Int + postById: { // args + id?: number | null; // Int } } } -export interface NexusGenAbstractTypeMembers {} +export interface NexusGenAbstractTypeMembers { +} -export interface NexusGenTypeInterfaces {} +export interface NexusGenTypeInterfaces { +} -export type NexusGenObjectNames = keyof NexusGenObjects +export type NexusGenObjectNames = keyof NexusGenObjects; -export type NexusGenInputNames = keyof NexusGenInputs +export type NexusGenInputNames = keyof NexusGenInputs; -export type NexusGenEnumNames = keyof NexusGenEnums +export type NexusGenEnumNames = keyof NexusGenEnums; -export type NexusGenInterfaceNames = never +export type NexusGenInterfaceNames = never; -export type NexusGenScalarNames = keyof NexusGenScalars +export type NexusGenScalarNames = keyof NexusGenScalars; -export type NexusGenUnionNames = never +export type NexusGenUnionNames = never; -export type NexusGenObjectsUsingAbstractStrategyIsTypeOf = never +export type NexusGenObjectsUsingAbstractStrategyIsTypeOf = never; -export type NexusGenAbstractsUsingStrategyResolveType = never +export type NexusGenAbstractsUsingStrategyResolveType = never; export type NexusGenFeaturesConfig = { abstractTypeStrategies: { @@ -243,51 +207,43 @@ export type NexusGenFeaturesConfig = { } export interface NexusGenTypes { - context: Context - inputTypes: NexusGenInputs - rootTypes: NexusGenRootTypes - inputTypeShapes: NexusGenInputs & NexusGenEnums & NexusGenScalars - argTypes: NexusGenArgTypes - fieldTypes: NexusGenFieldTypes - fieldTypeNames: NexusGenFieldTypeNames - allTypes: NexusGenAllTypes - typeInterfaces: NexusGenTypeInterfaces - objectNames: NexusGenObjectNames - inputNames: NexusGenInputNames - enumNames: NexusGenEnumNames - interfaceNames: NexusGenInterfaceNames - scalarNames: NexusGenScalarNames - unionNames: NexusGenUnionNames - allInputTypes: - | NexusGenTypes['inputNames'] - | NexusGenTypes['enumNames'] - | NexusGenTypes['scalarNames'] - allOutputTypes: - | NexusGenTypes['objectNames'] - | NexusGenTypes['enumNames'] - | NexusGenTypes['unionNames'] - | NexusGenTypes['interfaceNames'] - | NexusGenTypes['scalarNames'] - allNamedTypes: - | NexusGenTypes['allInputTypes'] - | NexusGenTypes['allOutputTypes'] - abstractTypes: NexusGenTypes['interfaceNames'] | NexusGenTypes['unionNames'] - abstractTypeMembers: NexusGenAbstractTypeMembers - objectsUsingAbstractStrategyIsTypeOf: NexusGenObjectsUsingAbstractStrategyIsTypeOf - abstractsUsingStrategyResolveType: NexusGenAbstractsUsingStrategyResolveType - features: NexusGenFeaturesConfig + context: Context; + inputTypes: NexusGenInputs; + rootTypes: NexusGenRootTypes; + inputTypeShapes: NexusGenInputs & NexusGenEnums & NexusGenScalars; + argTypes: NexusGenArgTypes; + fieldTypes: NexusGenFieldTypes; + fieldTypeNames: NexusGenFieldTypeNames; + allTypes: NexusGenAllTypes; + typeInterfaces: NexusGenTypeInterfaces; + objectNames: NexusGenObjectNames; + inputNames: NexusGenInputNames; + enumNames: NexusGenEnumNames; + interfaceNames: NexusGenInterfaceNames; + scalarNames: NexusGenScalarNames; + unionNames: NexusGenUnionNames; + allInputTypes: NexusGenTypes['inputNames'] | NexusGenTypes['enumNames'] | NexusGenTypes['scalarNames']; + allOutputTypes: NexusGenTypes['objectNames'] | NexusGenTypes['enumNames'] | NexusGenTypes['unionNames'] | NexusGenTypes['interfaceNames'] | NexusGenTypes['scalarNames']; + allNamedTypes: NexusGenTypes['allInputTypes'] | NexusGenTypes['allOutputTypes'] + abstractTypes: NexusGenTypes['interfaceNames'] | NexusGenTypes['unionNames']; + abstractTypeMembers: NexusGenAbstractTypeMembers; + objectsUsingAbstractStrategyIsTypeOf: NexusGenObjectsUsingAbstractStrategyIsTypeOf; + abstractsUsingStrategyResolveType: NexusGenAbstractsUsingStrategyResolveType; + features: NexusGenFeaturesConfig; } + declare global { - interface NexusGenPluginTypeConfig {} - interface NexusGenPluginFieldConfig< - TypeName extends string, - FieldName extends string, - > {} - interface NexusGenPluginInputFieldConfig< - TypeName extends string, - FieldName extends string, - > {} - interface NexusGenPluginSchemaConfig {} - interface NexusGenPluginArgConfig {} -} + interface NexusGenPluginTypeConfig { + } + interface NexusGenPluginInputTypeConfig { + } + interface NexusGenPluginFieldConfig { + } + interface NexusGenPluginInputFieldConfig { + } + interface NexusGenPluginSchemaConfig { + } + interface NexusGenPluginArgConfig { + } +} \ No newline at end of file diff --git a/orm/solid-start/prisma/seed.ts b/orm/solid-start/prisma/seed.ts index cadf81e70376..4b645af2e267 100644 --- a/orm/solid-start/prisma/seed.ts +++ b/orm/solid-start/prisma/seed.ts @@ -1,7 +1,8 @@ import { PrismaClient, Prisma } from '../src/generated/prisma/client' -import { withAccelerate } from '@prisma/extension-accelerate' +import { PrismaPg } from '@prisma/adapter-pg' -const prisma = new PrismaClient().$extends(withAccelerate()) +const pool = new PrismaPg({ connectionString: process.env.DATABASE_URL! }) +const prisma = new PrismaClient({ adapter: pool }) const userData: Prisma.UserCreateInput[] = [ { diff --git a/orm/typedsql/prisma/seed.ts b/orm/typedsql/prisma/seed.ts index 8f700b62a066..c98f477471f0 100644 --- a/orm/typedsql/prisma/seed.ts +++ b/orm/typedsql/prisma/seed.ts @@ -1,6 +1,6 @@ import 'dotenv/config' import { PrismaClient, Prisma, User } from '../prisma/generated/client' -import { PrismaBetterSQLite3 } from '@prisma/adapter-better-sqlite3' +import { PrismaBetterSqlite3 } from '@prisma/adapter-better-sqlite3' const NUM_USERS = 1000 const COUNT_BLUE = 300 @@ -18,7 +18,7 @@ enum EventType { CheckedOut = 'CheckedOut', } -const adapter = new PrismaBetterSQLite3({ url: process.env.DATABASE_URL || 'file:./dev.db' }) +const adapter = new PrismaBetterSqlite3({ url: process.env.DATABASE_URL || 'file:./dev.db' }) const prisma = new PrismaClient({ adapter }) async function main() { diff --git a/orm/typedsql/src/index.ts b/orm/typedsql/src/index.ts index 858ab8ed0efb..786b1cc127f3 100644 --- a/orm/typedsql/src/index.ts +++ b/orm/typedsql/src/index.ts @@ -1,12 +1,12 @@ import 'dotenv/config' import { PrismaClient } from '../prisma/generated/client' -import { PrismaBetterSQLite3 } from '@prisma/adapter-better-sqlite3' +import { PrismaBetterSqlite3 } from '@prisma/adapter-better-sqlite3' import { conversionByVariant } from '../prisma/generated/sql' import { filterTrackingEvents } from '../prisma/generated/sql' import { getTrackingEvents } from '../prisma/generated/sql' async function main() { - const adapter = new PrismaBetterSQLite3({ url: process.env.DATABASE_URL || 'file:./dev.db' }) + const adapter = new PrismaBetterSqlite3({ url: process.env.DATABASE_URL || 'file:./dev.db' }) const prisma = new PrismaClient({ adapter }) const stats = await prisma.$queryRawTyped(conversionByVariant()) diff --git a/package.json b/package.json new file mode 100644 index 000000000000..c26712e7efe7 --- /dev/null +++ b/package.json @@ -0,0 +1,15 @@ +{ + "name": "prisma-examples", + "type": "module", + "private": true, + "scripts": { + "test": "vitest run" + }, + "devDependencies": { + "@prisma/dev": "latest", + "@types/node": "^25.0.3", + "execa": "^9.5.2", + "typescript": "^5.7.2", + "vitest": "^3.0.4" + } +} diff --git a/tests/databases.test.ts b/tests/databases.test.ts new file mode 100644 index 000000000000..a9d09ad23235 --- /dev/null +++ b/tests/databases.test.ts @@ -0,0 +1,16 @@ +import { testExample } from './fixtures.js' +import { describe, test } from 'vitest' + +describe.concurrent('Database Examples', () => { + // PostgreSQL examples + testExample('databases/prisma-postgres') + + // Skipped examples + describe('databases/postgresql-supabase', () => { + test.skip('requires Supabase setup', () => {}) + }) + + describe('databases/sql-server', () => { + test.skip('requires SQL Server setup', () => {}) + }) +}) diff --git a/tests/fixtures.ts b/tests/fixtures.ts new file mode 100644 index 000000000000..dd171d87ff8b --- /dev/null +++ b/tests/fixtures.ts @@ -0,0 +1,100 @@ +import { describe, test, afterAll } from 'vitest' +import { startPrismaDevServer } from '@prisma/dev' +import { execa } from 'execa' +import * as fs from 'node:fs' +import * as path from 'node:path' + +type Server = Awaited> + +export interface TestExampleOptions { + skipSeed?: boolean + skipMigrate?: boolean +} + +export function testExample(examplePath: string, options?: TestExampleOptions) { + describe(examplePath, () => { + let server: Server + + afterAll(async () => { + await server?.close() + }) + + test('prisma setup', async () => { + server = await startPrismaDevServer({ databaseIdleTimeoutMillis: 300000 }) + const url = server.database.connectionString + const cwd = path.join(process.cwd(), examplePath) + const env = { ...process.env, DATABASE_URL: url } + + console.log(`\n[${examplePath}] Installing dependencies...`) + await execa('npm', ['install'], { cwd, env, stdio: 'inherit' }) + + console.log(`\n[${examplePath}] Running prisma generate...`) + await execa('npx', ['prisma', 'generate'], { cwd, env, stdio: 'inherit' }) + + if (!options?.skipMigrate) { + console.log(`\n[${examplePath}] Running prisma db push...`) + await execa('npx', ['prisma', 'db', 'push', '--accept-data-loss'], { + cwd, + env, + stdio: 'inherit', + }) + } + + // Check for seed in prisma.config.ts (Prisma v7+) + const configPath = path.join(cwd, 'prisma.config.ts') + if (!options?.skipSeed && fs.existsSync(configPath)) { + const content = fs.readFileSync(configPath, 'utf-8') + if (content.includes('seed:')) { + console.log(`\n[${examplePath}] Running prisma db seed...`) + await execa('npx', ['prisma', 'db', 'seed'], { cwd, env, stdio: 'inherit' }) + } + } + + console.log(`\n[${examplePath}] Completed successfully!`) + }) + }) +} + +// For SQLite examples that don't need @prisma/dev server +export function testSqliteExample(examplePath: string, options?: { generateSql?: boolean }) { + describe(examplePath, () => { + test('prisma setup', async () => { + const cwd = path.join(process.cwd(), examplePath) + + // Remove existing SQLite database to ensure clean state + const dbPath = path.join(cwd, 'dev.db') + if (fs.existsSync(dbPath)) { + fs.unlinkSync(dbPath) + } + + console.log(`\n[${examplePath}] Installing dependencies...`) + await execa('npm', ['install'], { cwd, stdio: 'inherit' }) + + console.log(`\n[${examplePath}] Running prisma generate...`) + await execa('npx', ['prisma', 'generate'], { cwd, stdio: 'inherit' }) + + console.log(`\n[${examplePath}] Running prisma db push...`) + await execa('npx', ['prisma', 'db', 'push', '--accept-data-loss'], { + cwd, + stdio: 'inherit', + }) + + if (options?.generateSql) { + console.log(`\n[${examplePath}] Running prisma generate --sql...`) + await execa('npx', ['prisma', 'generate', '--sql'], { cwd, stdio: 'inherit' }) + } + + // Check for seed in prisma.config.ts (Prisma v7+) + const configPath = path.join(cwd, 'prisma.config.ts') + if (fs.existsSync(configPath)) { + const content = fs.readFileSync(configPath, 'utf-8') + if (content.includes('seed:')) { + console.log(`\n[${examplePath}] Running prisma db seed...`) + await execa('npx', ['prisma', 'db', 'seed'], { cwd, stdio: 'inherit' }) + } + } + + console.log(`\n[${examplePath}] Completed successfully!`) + }) + }) +} diff --git a/tests/orm.test.ts b/tests/orm.test.ts new file mode 100644 index 000000000000..c614e995437c --- /dev/null +++ b/tests/orm.test.ts @@ -0,0 +1,65 @@ +import { testExample, testSqliteExample } from './fixtures.js' +import { describe, test } from 'vitest' + +describe.concurrent('ORM Examples', () => { + testExample('orm/ai-sdk-nextjs') + testExample('orm/astro') + testExample('orm/betterauth-astro') + testExample('orm/betterauth-nextjs') + testExample('orm/clerk-astro') + testExample('orm/clerk-nextjs') + testExample('orm/cloudflare-workers') + testExample('orm/express') + testExample('orm/fastify') + testExample('orm/fastify-graphql') + testExample('orm/fastify-graphql-sdl-first') + testExample('orm/graphql') + testExample('orm/graphql-auth') + testExample('orm/graphql-nexus') + testExample('orm/graphql-sdl-first') + testExample('orm/graphql-subscriptions') + testExample('orm/hapi') + testExample('orm/hapi-graphql-sdl-first') + testExample('orm/hono') + testExample('orm/koa') + testExample('orm/nest') + testExample('orm/nest-graphql') + testExample('orm/nest-graphql-sdl-first') + testExample('orm/nextjs') + testExample('orm/nextjs-graphql') + testExample('orm/nextjs-trpc') + testExample('orm/prisma-mocking-javascript') + testExample('orm/react-router-7') + testExample('orm/script', { skipSeed: true }) + testExample('orm/solid-start') + testExample('orm/starter') + testExample('orm/sveltekit') + testExample('orm/testing-express') + + testSqliteExample('orm/typedsql', { generateSql: true }) + + // Skipped examples + describe('orm/authjs-nextjs', () => { + test.skip('npm install has peer dependency conflicts', () => {}) + }) + + describe('orm/grpc', () => { + test.skip('grpc dependencies have issues', () => {}) + }) + + describe('orm/hapi-graphql', () => { + test.skip('prisma generate fails', () => {}) + }) + + describe('orm/nuxt', () => { + test.skip('requires special nuxt setup', () => {}) + }) + + describe('orm/nuxt-prisma-module', () => { + test.skip('requires special nuxt setup', () => {}) + }) + + describe('orm/postgis-express', () => { + test.skip('requires PostGIS extension', () => {}) + }) +}) diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 000000000000..b5fbd0b0c190 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "esModuleInterop": true, + "strict": true, + "skipLibCheck": true, + "outDir": "dist", + "rootDir": "." + }, + "include": ["tests/**/*.ts"], + "exclude": ["node_modules"] +} diff --git a/vitest.config.ts b/vitest.config.ts new file mode 100644 index 000000000000..cabb7f2cd6f2 --- /dev/null +++ b/vitest.config.ts @@ -0,0 +1,20 @@ +import { defineConfig } from 'vitest/config' + +export default defineConfig({ + test: { + testTimeout: 300000, + hookTimeout: 120000, + pool: 'forks', + poolOptions: { + forks: { + singleFork: false, + }, + }, + maxConcurrency: 8, + fileParallelism: true, + sequence: { + concurrent: true, + }, + include: ['tests/**/*.test.ts'], + }, +})