[Docs] Testing guide: running and debugging the integration suites

Aperta Adatta ai principianti
#369 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
86/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
postgresql, typescript

Direzione di ricerca

Inizia da CONTRIBUTING.md, backend/package.json e backend/vitest.config.mts per individuare le suite di test, gli script npm e le impostazioni delle porte; consulta tests/factories per le indicazioni sulle factory. Documenta come eseguire una suite, un file o un singolo test, esaminare un test di integrazione non riuscito e ripulire un cluster incorporato obsoleto, comprese le differenze tra macOS e Linux. Il lavoro è completo quando la guida è collegata dal README e un reviewer può seguire i relativi comandi su un clone pulito.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

Phase: 9 — Deploy & CI (see ROADMAP.md)

Description

CONTRIBUTING.md covers setup and what to run before a PR, but not how the self-contained embedded-Postgres integration suites work: which ports they use, how to run one file or one test, how to keep a database around to inspect after a failure, and what to do when a stale cluster blocks a port. New contributors lose time to this, and booking/referral/order work requires integration tests.

Requirements & context

What to do:

  • Add a testing section to CONTRIBUTING.md (or backend/tests/README.md) covering unit vs integration vs property vs testnet suites and their npm scripts.
  • Document per-suite ports, running a single file/test, debugging a failing test, and cleaning up stale embedded clusters.
  • Explain how to use the factories in tests/factories for new tests.

Files likely involved:

  • CONTRIBUTING.md
  • backend/tests/factories/index.ts
  • backend/vitest.config.mts
  • backend/package.json

Edge cases / constraints:

  • Keep it accurate for macOS and Linux; note anything that differs.
  • Follow the ARCHITECTURE_ESSENTIALS.md hard rules (module boundaries, append-only orders, DB-level booking guarantees, no invented schema fields without documenting them for ARCHITECTURE.md §4 in a docs.d/ fragment).

Suggested execution

  1. Fork the repo and branch off main: git checkout -b docs/testing-guide-running-and-debugging-the-integrat
  2. Implement the changes above. If you hit a design question the issue doesn't answer, comment here before guessing.
  3. Run npm run typecheck, npm test and npm run test:integration in backend/. Booking, referral, order and payment flows need integration tests, not only unit tests (AGENTS.md).
  4. Commit with a clear message, for example: docs(docs): Testing guide: running and debugging the integration suites
  5. Open a PR against main with Closes #<this issue number> in the description.

Definition of done

  • Testing guide merged
  • Linked from the README
  • A changelog.d/<issue-number>-<short-slug>.md fragment (see changelog.d/README.md), and, if models or endpoints changed, the new ARCHITECTURE.md §4 / docs/api/README.md lines in a docs.d/<issue-number>-<short-slug>.md fragment (see docs.d/README.md)
  • CI green

How this will be reviewed

Reviewer follows the guide on a clean clone and checks each command works as written.

Guidelines

  • Claiming: comment to claim before you start, and check nobody else is assigned.
  • PR description: say what changed and why, include Closes #<issue>, and paste test output (plus screenshots for UI work).
  • Timeframe: open a PR within 7 days of assignment. If you get stuck, say so in the issue early rather than going quiet.

Not blocked by: any other open issue.

Lingua principale
TypeScript
Stelle
11
Fork
57
Merge medio
20h 41m
PR unite (30g)
67

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di DocForum/docforum-core

Tutte le issue di DocForum/docforum-core

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.