Skip to content

[codex] Share epic DB setup in one suite#3296

Merged
maphew merged 2 commits into
gastownhall:mainfrom
maphew:codex/bd-itp-5-epic-suite
Apr 15, 2026
Merged

[codex] Share epic DB setup in one suite#3296
maphew merged 2 commits into
gastownhall:mainfrom
maphew:codex/bd-itp-5-epic-suite

Conversation

@maphew

@maphew maphew commented Apr 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • convert the DB-backed epic tests into a single TestEpicSuite
  • add a small helper for shared store/context setup and repeated issue/dependency creation
  • leave the init-only command registration test separate

Why

This is the bd-itp.5 follow-on from the refactor epic. The aim was to apply the shared-suite pattern only where it is actually low-risk and measurable.

cmd/bd/epic_test.go was a live pure-DB target with repeated newTestStore() setup and no integration-style global-state behavior. The change reduces repeated setup while preserving test intent and keeping the non-DB init test isolated.

Validation

  • CGO_ENABLED=1 go test -tags gms_pure_go -run '^TestEpic' ./cmd/bd

Notes

  • DB initializations in the file dropped from 3 to 1.
  • Runtime improvement was modest in this environment, but the bigger payoff is lower repeated setup and a clearer template for similar pure-DB files.

@maphew maphew marked this pull request as ready for review April 15, 2026 22:35
@codecov-commenter

codecov-commenter commented Apr 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@maphew maphew left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — LGTM. Subtests filter by unique epic IDs so the shared store is safe. One non-blocking observation: h.t = t reassignment inside each t.Run would race if anyone later adds t.Parallel() — consider passing t into helper methods in a follow-up. Worth confirming macOS CI is green on current HEAD before merge.

@maphew maphew merged commit 63a24bc into gastownhall:main Apr 15, 2026
37 checks passed
Bella-Giraffety pushed a commit to Bella-Giraffety/beads that referenced this pull request Apr 16, 2026
* test: share epic DB setup in one suite (bd-itp.5)

* test: pass subtest testing.T through epic helper
Bella-Giraffety pushed a commit to Bella-Giraffety/beads that referenced this pull request Apr 17, 2026
* test: share epic DB setup in one suite (bd-itp.5)

* test: pass subtest testing.T through epic helper
mzlee pushed a commit to mzlee/beads that referenced this pull request Apr 22, 2026
* test: share epic DB setup in one suite (bd-itp.5)

* test: pass subtest testing.T through epic helper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants