Skip to content

Conversation

ronjalh
Copy link
Member

@ronjalh ronjalh commented Oct 17, 2026

Summary

One command that runs everything a pull request must pass, and fails when the database tests were skipped. Part of #76 (not closing it: whether the school server can run CI is still open).

What's in it

  • npm run check (scripts/check.mjs): Prisma client (and the GraphQL types, once backend/codegen.ts exists), lint, type check of the backend, type check and build of the frontend, then all the tests. It fails when DATABASE_URL is missing (environment or backend/.env) and when any test is skipped (read from Vitest's JSON report). A normal npm test passes with skipped database tests, so a green run could hide that the search and the API were never tested.
  • .github/pull_request_template.md: base dev, npm run check, docs, AI usage.
  • README ("Working in this repository") explains when to run it.

Not in this PR (stays in #76)

  • A CI workflow. I could not find out whether the course server has runners: the Actions settings and runners answer 403 for my account, and the repository has never had a workflow run. A workflow written without being able to run it would either do nothing or fail on every pull request, so it is better to ask someone with admin rights first. npm run check is what such a workflow would call.
  • End-to-end tests with a browser (needs a search page in the frontend).

Testing

  • Without a database: npm run check stops at once with a clear message and exit code 1.
  • With a migrated and seeded database: lint, both type checks, the build and all 45 tests run, 0 skipped, exit code 0.
  • With a test marked it.skip added on purpose: "1 tests were skipped", exit code 1 (the file was removed again).

🤖 Generated with Claude Code

npm run check runs the lint, the type checks, the build and all the tests,
and fails when a test is skipped or DATABASE_URL is missing, so a green
result always means that the search and the API were tested.
@ronjalh ronjalh requested a review from a team as a code owner October 17, 2026 08:36
@ronjalh ronjalh self-assigned this Oct 17, 2026
@ronjalh ronjalh mentioned this pull request Oct 17, 2026
9 tasks
@ronjalh ronjalh marked this pull request as draft October 17, 2026 09:10
@ronjalh
Copy link
Member Author

ronjalh commented Oct 17, 2026

Ikke strengt tatt nødvendig, men litt nice for å sjekke at ting funker

@ronjalh ronjalh marked this pull request as ready for review October 17, 2026 10:10
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant