codeflash-internal/tiles/codeflash-internal-rules/rules/testing-rules.md
Kevin Turcios dfc56f19a0 feat: add Tessl tiles for codeflash-internal (rules, docs, skills)
Three private tiles published to the codeflash workspace:
- codeflash-internal-rules: 6 eager rules (code-style, architecture,
  optimization-patterns, git-conventions, testing-rules, multi-language-handlers)
- codeflash-internal-docs: 8 lazy doc pages (domain-types, optimization-pipeline,
  test-generation-pipeline, context-extraction, aiservice/cf-api endpoints,
  configuration-thresholds, llm-provider-abstraction)
- codeflash-internal-skills: 4 on-demand skills (debug-optimization-failure,
  add-language-support, add-api-endpoint, debug-test-generation)
2026-02-14 22:16:33 -05:00

20 lines
968 B
Markdown

# Testing Rules
## Python (aiservice)
- Tests in `tests/` by feature: `optimizer/`, `testgen/`, `testgen_postprocessing/`, `testgen_instrumentation/`, `integration/`, `validators/`
- `@pytest.mark.asyncio` for async tests
- `pytest.ini` sets `DJANGO_SETTINGS_MODULE = aiservice.settings`
- `conftest.py` provides `normalize_code()` helper (AST parse/unparse for quote normalization)
- Test factories: `create_optimizer_context()`, `create_refiner_context()`
- Run tests: `uv run pytest` (all), `uv run pytest tests/path/test_file.py::test_name -v` (single)
## JS/TS (cf-api)
- Tests use dependency injection: `setXxxDependencies()` / `resetXxxDependencies()`
## PR Review
- **Always comment on**: Logic errors, security vulnerabilities, test name typos, breaking changes without migration
- **Never comment on**: Code style/formatting (linters handle it), "consider" suggestions, performance without profiling data
- Limit to 5-7 high-signal comments per review