test(activity): add integration tests for full pipeline #328

Merged
fuzzy merged 1 commit from phase08-integration-tests into main 2026-07-07 21:33:41 +00:00
Owner

What

Add end-to-end integration tests, completing #278.

New tests

  • TestIntegrationFullPipeline — 6 events across 3 days, multi-page mock client. Verifies cache persistence, all sparkline types render (PRs, Issues, Contributions).
  • TestIntegrationViewSwitchCacheReuse — simulates switching between user-auser-buser-a. Verifies each context has independent cache, renders differ, and cache is reused on switch-back.
  • TestIntegrationEmptyThenData — new user with no data initially shows "No activity data", then data appears on second fetch. Verifies empty → populated transition.

New mock

multiPageClient — supports proper pagination (offset/limit calculation) for simulating multi-page API responses.

Coverage

99 test functions across 9 files in the activity package.

References: #278, #275, #276, #277

Testing

  • 3 new integration tests
  • go test -race ./... — all pass
## What Add end-to-end integration tests, completing #278. ### New tests - **TestIntegrationFullPipeline** — 6 events across 3 days, multi-page mock client. Verifies cache persistence, all sparkline types render (PRs, Issues, Contributions). - **TestIntegrationViewSwitchCacheReuse** — simulates switching between `user-a` → `user-b` → `user-a`. Verifies each context has independent cache, renders differ, and cache is reused on switch-back. - **TestIntegrationEmptyThenData** — new user with no data initially shows "No activity data", then data appears on second fetch. Verifies empty → populated transition. ### New mock `multiPageClient` — supports proper pagination (offset/limit calculation) for simulating multi-page API responses. ### Coverage 99 test functions across 9 files in the activity package. References: #278, #275, #276, #277 ## Testing - [x] 3 new integration tests - [x] `go test -race ./...` — all pass
test(activity): add integration tests for full pipeline
All checks were successful
Test and Release / test (pull_request) Successful in 3m34s
Test and Release / lint (pull_request) Successful in 4m45s
7dad6bd0ca
- TestIntegrationFullPipeline: end-to-end test with multi-page mock
  client, 3 days of PR/issue/push events, cache persistence, and
  render output verification for all sparkline types
- TestIntegrationViewSwitchCacheReuse: simulates context switching
  (user-a -> user-b -> user-a), verifies each context's cache
  is independent and renders from cache immediately
- TestIntegrationEmptyThenData: new user with no data initially,
  then data appears on second fetch — verifies empty state and
  transition to populated render
- multiPageClient mock: supports proper pagination for >1 page

Ref: #278, #275, #276, #277
fuzzy scheduled this pull request to auto merge when all checks succeed 2026-07-07 21:29:13 +00:00
fuzzy added this to the Steeper project 2026-07-07 21:29:17 +00:00
fuzzy self-assigned this 2026-07-07 21:29:18 +00:00
the.auditor left a comment

Review

Result: Approved — no blocking issues.

Summary: Adds internal/activity/integration_test.go with 3 end-to-end integration tests. TestIntegrationFullPipeline exercises 6 events across 3 days, verifying cache persistence and all sparkline types. TestIntegrationViewSwitchCacheReuse validates independent context caches and render differences. TestIntegrationEmptyThenData tests the empty-to-populated transition. New multiPageClient mock supports offset/limit pagination + since filtering. ROADMAP2.md updated.

Checklist:

  • Correctness: multiPageClient pagination correct, tests use real DB via RefreshContext
  • Completeness: Closes #278 — all 3 integration scenarios covered (full pipeline, view switching, empty→data)
  • Test coverage: 3 tests exercising the full stack (cache → fetch → aggregate → render)
  • Race-safe: go test -race passes
## Review **Result: Approved** — no blocking issues. **Summary:** Adds `internal/activity/integration_test.go` with 3 end-to-end integration tests. `TestIntegrationFullPipeline` exercises 6 events across 3 days, verifying cache persistence and all sparkline types. `TestIntegrationViewSwitchCacheReuse` validates independent context caches and render differences. `TestIntegrationEmptyThenData` tests the empty-to-populated transition. New `multiPageClient` mock supports offset/limit pagination + `since` filtering. ROADMAP2.md updated. **Checklist:** - Correctness: ✅ multiPageClient pagination correct, tests use real DB via RefreshContext - Completeness: ✅ Closes #278 — all 3 integration scenarios covered (full pipeline, view switching, empty→data) - Test coverage: ✅ 3 tests exercising the full stack (cache → fetch → aggregate → render) - Race-safe: ✅ `go test -race` passes
fuzzy merged commit 7dad6bd0ca into main 2026-07-07 21:33:41 +00:00
fuzzy deleted branch phase08-integration-tests 2026-07-07 21:33:41 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/steeper!328
No description provided.