Skip to content

Testing strategy and conventions guide #545

Description

@codebestia

Write docs/testing.md: the cross-app testing philosophy and the conventions a contributor must follow. The most important rule: tests never start real external services — Redis, Postgres, S3/MinIO are always mocked or replaced with in-process fakes (ioredis-mock, the local-disk object store, mocked db), so pnpm test runs with no Docker.

Acceptance criteria:

  • States the no-external-services rule explicitly, with the reasoning and the approved substitutes for each dependency
  • Documents the per-app runners and commands (vitest for backend and web, pytest for the AI agent, cargo test for contracts)
  • Explains the established Drizzle mocking pattern used across the backend suite, and why .values() sometimes has to be both thenable and expose .returning()
  • Documents that socket handlers must be exercised via the enveloped dispatch event, not by grabbing a raw socket.on listener
  • Notes the trap that shared in-process rate-limit counters leak between tests unless reset

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programdocumentationImprovements or additions to documentationdxtesting

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions