Files
LibreMail-Bug-Report-Ingest/internal/integration
JMR-devandClaude Opus 4.8 0d66969a97 #16 Test suite: end-to-end pipeline integration tests
Add internal/integration: a build-tag-free, host-only test package that
wires the Worker's REAL components together and exercises the full flow,
catching regressions in how the stages compose that per-ticket unit tests
miss. CI (#3) runs it automatically via `go test ./...` — no ci.yml change.

Scenarios (real http.Handler over loopback, real scrub->encrypt->store
Sink + host AES-256-GCM keyring, real lifecycle.Manager over a shared
MemoryStore, real publish.Publisher driving the real GitHub client against
a mock GitHub REST server, real schedule.Run gate):

- ingest->scrub->encrypt->store: POST /v1/reports with PII is 202; the
  object at rest is AES-256-GCM ciphertext leaking neither the PII nor the
  placeholder text, and decrypts to the fully scrubbed body.
- pending listed then removed via the authed admin API (#11); fail-closed
  401 without a token; removed report drops from pending.
- Friday-17:00-Central cron publishes one labeled issue per pending report
  with PII scrubbed from the issue body, marks each published, and a second
  run creates no new issues (cross-run de-dup); a later ingest publishes
  exactly once.
- a removed report is never published (admin removal x publish, #11 x #14).
- endpoint status-code contract on the assembled handler (ingest + admin).

Deterministic and fast: virtual clock + zero GitHub request spacing, no
real sleeps or network. No production code, wrangler.jsonc, or ci.yml
changes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-02 17:00:42 -05:00
..