Closed dearshrewdwit closed 2 years ago
The initial work on this gave a great foundation to go on and has been introduced to a ci
branch on the cinema API exercise: https://github.com/boolean-uk/database-cinema-booking-api/tree/ci
Some changes
main
for the main branch CI to test the route included with the exerciseroutes
for the exercise route tests, these are what students will run as they workextensions
for students to add extension tests, this includes one ready made extension test.yml
files in the GH workflows folder, one for the main branch (currently pointing to ci
) and one for PR'snpx redoc-cli build openapi.yml -o docs/index.html
was used to generateThe reason for splitting the core & extension test suites is so students can focus on the core criteria first and get the exercise into a complete state.
The reason for splitting the main branch & core criteria tests is so we can have passing CI on main while including a complete failing test suite for the core criteria.
Todo
ci
branch, complete the exercise & create a PR to upstream ci
branch to test everything works as intended from the POV of a studentmain
branch instead of ci
and merge the ci
branchAll prisma repos need something like the below to add a query level log for students to get visibility on their queries:
const { PrismaClient } = require("@prisma/client")
let logLevel = {
log: ['query'],
}
if (process.env.NODE_ENV === 'test') {
logLevel = {}
}
const prisma = new PrismaClient(logLevel)
module.exports = prisma
All API exercises need a setup like the above cinema API exercise: https://www.notion.so/boolean/Building-APIs-eb8dfb6016344271927ac65fdfd7afa8
Repository: https://github.com/boolean-uk/test-prisma-ci
npm run api-docs
and view the spec.npm test
to run testsIntention
Feedback requested - please add comments below.
Feel free to branch and open PRs with ideas/changes - and link PRs in comments below.