Skip to content

Commit e8ac7b0

Browse files
Harxhitclaude
andcommitted
fix(ci): run api-test orchestration from backend dir so prisma finds schema
npm exec ran prisma/tsx from the repo root, where ./prisma/schema.prisma does not exist. cd into apps/backend first; reference the collection and schema by package-relative paths. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent e219181 commit e8ac7b0

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

.github/scripts/run-api-tests.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ PORT="${PORT:-3000}"
1818
BASE_URL="http://localhost:${PORT}"
1919
HEALTH_RETRIES="${HEALTH_RETRIES:-30}"
2020
HEALTH_INTERVAL="${HEALTH_INTERVAL:-2}"
21-
COLLECTION="apps/backend/postman/DevCard.postman_collection.json"
21+
COLLECTION="postman/DevCard.postman_collection.json"
2222

2323
SERVER_PID=""
2424

@@ -31,13 +31,17 @@ cleanup() {
3131
}
3232
trap cleanup EXIT
3333

34+
# Prisma and tsx resolve paths relative to the working directory, so run
35+
# everything from the backend package rather than the repo root.
36+
cd apps/backend
37+
3438
echo "::group::Apply migrations and seed"
35-
npm --prefix apps/backend exec prisma migrate deploy
36-
npm --prefix apps/backend run db:seed
39+
npx prisma migrate deploy
40+
npm run db:seed
3741
echo "::endgroup::"
3842

3943
echo "::group::Start API server"
40-
npm --prefix apps/backend exec tsx src/server.ts &
44+
npx tsx src/server.ts &
4145
SERVER_PID=$!
4246
echo "Server started (pid ${SERVER_PID})"
4347
echo "::endgroup::"

0 commit comments

Comments
 (0)