Add unit tests for src/backend/processor/response.go
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 432
- Forks
- 51
- PR merge metrics
- No merged PRs in 30d
Description
src/backend/processor/response.go is the only file in the processor package and has no response_test.go. Response post-processing (PII restoration / streaming handling) is on the hot path and worth testing in isolation.
What to add
Create src/backend/processor/response_test.go with table-driven tests for:
- Non-streaming JSON response — masked values are restored to originals
- Streaming/SSE response — chunks are reassembled and restored correctly
- Empty body / no PII — passes through unchanged
- Mapping miss (response contains a masked token with no entry in the map) — fallback is documented and tested
Hints
- Mirror the style of
src/backend/pii/database_test.gofor table-driven tests. - Construct mappings manually rather than wiring up the full detector.
- Run
go test ./src/backend/processor/....
Difficulty: good first issue, ~1–2 hours.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/backend/processor/response.go to identify the response post-processing entry points and behavior for JSON and streaming responses. Mirror the table-driven style in src/backend/pii/database_test.go, construct mappings manually, and run go test ./src/backend/processor/...; done means the listed restoration, passthrough, and mapping-miss cases are covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend, testing
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 85/100