- Create docs/bible/ with 10 structured chapters (overview, architecture, API, data models, collectors, parsers, exporters, build, testing, decisions) - All documentation in English per ADL-007 - Record all existing architectural decisions in docs/bible/10-decisions.md - Slim README.md to user-facing quick start only - Replace CLAUDE.md with a single directive to read and follow the Bible - Remove absorbed files: REANIMATOR_EXPORT.md, docs/INTEGRATION_GUIDE.md, and all vendor parser README.md files Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
44 lines
1.2 KiB
Markdown
44 lines
1.2 KiB
Markdown
# 09 — Testing
|
|
|
|
## Required before merge
|
|
|
|
```bash
|
|
go test ./...
|
|
```
|
|
|
|
All tests must pass before any change is merged.
|
|
|
|
## Where to add tests
|
|
|
|
| Change area | Test location |
|
|
|-------------|---------------|
|
|
| Collectors | `internal/collector/*_test.go` |
|
|
| HTTP handlers | `internal/server/*_test.go` |
|
|
| Exporters | `internal/exporter/*_test.go` |
|
|
| Parsers | `internal/parser/vendors/<vendor>/*_test.go` |
|
|
|
|
## Exporter tests
|
|
|
|
The Reanimator exporter has comprehensive coverage:
|
|
|
|
| Test file | Coverage |
|
|
|-----------|----------|
|
|
| `reanimator_converter_test.go` | Unit tests per conversion function |
|
|
| `reanimator_integration_test.go` | Full export with realistic `AnalysisResult` |
|
|
|
|
Run exporter tests only:
|
|
```bash
|
|
go test ./internal/exporter/...
|
|
go test ./internal/exporter/... -v -run Reanimator
|
|
go test ./internal/exporter/... -cover
|
|
```
|
|
|
|
## Guidelines
|
|
|
|
- Prefer table-driven tests for parsing logic (multiple input variants).
|
|
- Do not rely on network access in unit tests.
|
|
- Test both the happy path and edge cases (missing fields, empty collections).
|
|
- When adding a new vendor parser, include at minimum:
|
|
- `Detect()` test with a positive and a negative sample file list.
|
|
- `Parse()` test with a minimal but representative archive.
|