Merge pull request #234 from amal66/olp-pr/testing-docs

[Docs 02] docs: testing policy in CONTRIBUTING + PR template
This commit is contained in:
Will Chen 2026-07-21 22:16:01 +08:00 committed by GitHub
commit 39dc609f95
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 49 additions and 0 deletions

30
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View file

@ -0,0 +1,30 @@
## Summary
<!-- What does this PR do, in one or two sentences? -->
## Why / Motivation
<!-- What problem does this solve? Why now, and why this approach?
Link the issue or context that prompted it. -->
## Changes
<!-- The notable changes, at a high level. Describe the outcome, not the diff. -->
## Tradeoffs & risks
<!-- What did you weigh? What could break, what's out of scope, and what
follow-ups (if any) does this leave behind? Note any security or
migration implications. -->
## How verified
<!-- How do you know this works? Tests added/run, manual steps, commands,
screenshots. Include the exact commands where relevant. -->
## Checklist
- [ ] Ran the relevant build/test command for the area changed.
- [ ] Reviewed `git diff` and removed unrelated changes.
- [ ] Updated docs / env examples if setup, config, or behavior changed.
- [ ] No secrets, API keys, real documents, or `.env` files committed.

View file

@ -54,3 +54,22 @@ Frontend:
```bash
npm run build --prefix frontend
```
## Testing
```bash
npm test --prefix backend # backend unit + route integration tests (vitest)
npm test --prefix frontend # frontend component/hook tests (vitest + jsdom)
npm run test:e2e # Playwright end-to-end suite — see docs/e2e-ci.md
node evals/run.mjs --threshold 1.0 # offline eval harness (no network, no API keys)
npm run test:stack --prefix backend # gated: real-Supabase auth/access tests (run `supabase start` first)
```
- New features and bug fixes should come with a test at the lowest layer that
can catch the regression: unit first, then route-level integration, then
end-to-end only for flows a browser is genuinely needed to prove.
- CI runs the build, unit/integration tests, and the eval harness on every PR
(`.github/workflows/ci.yml`), and the Playwright suite in a full local stack
(`.github/workflows/e2e.yml`).
- Tests that need a live Supabase or an LLM key are env-gated and skip cleanly
when the environment is absent — a plain `npm test` should always be green.