chore(test): remove test helpers that repeat existing ones from PR #282
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start in internal/indexer/sync_shared_test.go and internal/indexer/pipeline_test.go to compare setSyncBeforeCommitHook with the generic setHook, then in internal/graphstore/shared_test.go for the three setShared*Hook helpers and blockFirstOpen. Also check internal/daemon/catchup_test.go (runHeld, startFakeRun) and testbudget_test.go. Done when the duplicate helpers are removed, the affected tests call the shared helpers, and go test ./... still passes.
Written by the indexing model from the issue text.
Description
What kind of chore?
Test infrastructure
What needs doing?
PR #282 added four test helpers that repeat helpers their packages already have. Each fix keeps behavior the same and changes only test files.
internal/indexer/sync_shared_test.go:16:setSyncBeforeCommitHookrepeats the genericsetHookininternal/indexer/pipeline_test.go. Widen thetparameter ofsetHookto an interface withHelperandCleanup, so*rapid.Tfits. CallsetHook(t, &syncBeforeCommitHook, ...)instead.internal/graphstore/shared_test.go:setSharedOpenHook,setSharedCloseHookandsetSharedWaitHookdiffer only in the variable they set. Add one genericsetHook[T any](t, hook *T, value T)to the graphstore tests. Call it for all three.internal/daemon/catchup_test.go:145:runHeldinTestRunCatchUpSyncOnHeldStorerepeats theawaitEpisodeloop ofTestDaemonFlushLockRequeueGivesUpPerEpisode. Hoist one helper besidestartFakeRun, built on the receive helper intestbudget_test.go. Call it from both tests.internal/graphstore/shared_test.go:349:TestOpenOfSecondPathDoesNotWaitcopies the body of theblockFirstOpenclosure. That closure is local toTestSharedHandleWaitersShareOpen. MoveblockFirstOpento file level.
The line numbers come from the review at ecc22e07. Current lines can differ.
Why now?
The OpenSpec review of the shared-store-handle change flagged these copies under its fit lens. The copies came in with #282 (commit c6788f5d). A later edit to one copy will not reach the others, so the duplicates can drift apart and hide a test bug. Tidiness is the trigger here, so this is lower priority.
Does this touch anything load-bearing?
- The release pipeline (
release.yml,.goreleaser.yaml, signing) - The upgrade identity (
internal/upgrade/verify.go) - The perf baseline (
tools/bench/baseline.json) - The graph schema / meta-key layout
- None of these
Before submitting
- I searched existing issues and this is not a duplicate
- Dominant language
- Go
- Stars
- 0
- Forks
- 0
- Avg merge
- 5h 16m
- Merged PRs (30d)
- 107
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing 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.
More from seanb4t/codegraph-go
-
area:indexer bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
seanb4t/codegraph-go#385 ·
Maintainers usually reply within 1 day
-
chore needs-triage
Difficulty 1/5 Under an hour Newbie friendliness 88/100
seanb4t/codegraph-go#380 ·
Maintainers usually reply within 1 day
-
chore needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
seanb4t/codegraph-go#379 ·
Maintainers usually reply within 1 day
-
chore needs-triage
Difficulty 1/5 1-3 hours Newbie friendliness 84/100
seanb4t/codegraph-go#362 ·
Maintainers usually reply within 1 day
-
area:query bug priority:low spec-needed
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
seanb4t/codegraph-go#355 ·
Maintainers usually reply within 1 day
All issues in seanb4t/codegraph-go
Similar issues
-
enhancement exporter/awskinesis needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
open-telemetry/opentelemetry-collector-contrib#53334 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
erigontech/erigon#26523 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 83/100
SocialGouv/iterion#3376 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
seaweedfs/seaweedfs#12740 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day