chore(test): remove test helpers that repeat existing ones from PR #282

オープン 初心者向け
#284 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go, testing-qa
領域
testing

調査の方向性

internal/indexer/sync_shared_test.go と internal/indexer/pipeline_test.go から始めて、setSyncBeforeCommitHook と汎用の setHook を比較してください。次に internal/graphstore/shared_test.go で 3 つの setShared*Hook ヘルパーと blockFirstOpen を確認します。さらに internal/daemon/catchup_test.go(runHeld、startFakeRun)と testbudget_test.go も確認してください。重複したヘルパーが削除され、影響を受けるテストが共通ヘルパーを呼び出し、go test ./... が引き続き成功すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

area:indexer chore priority:low
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: setSyncBeforeCommitHook repeats the generic setHook in internal/indexer/pipeline_test.go. Widen the t parameter of setHook to an interface with Helper and Cleanup, so *rapid.T fits. Call setHook(t, &syncBeforeCommitHook, ...) instead.
  • internal/graphstore/shared_test.go: setSharedOpenHook, setSharedCloseHook and setSharedWaitHook differ only in the variable they set. Add one generic setHook[T any](t, hook *T, value T) to the graphstore tests. Call it for all three.
  • internal/daemon/catchup_test.go:145: runHeld in TestRunCatchUpSyncOnHeldStore repeats the awaitEpisode loop of TestDaemonFlushLockRequeueGivesUpPerEpisode. Hoist one helper beside startFakeRun, built on the receive helper in testbudget_test.go. Call it from both tests.
  • internal/graphstore/shared_test.go:349: TestOpenOfSecondPathDoesNotWait copies the body of the blockFirstOpen closure. That closure is local to TestSharedHandleWaitersShareOpen. Move blockFirstOpen to 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
主要言語
Go
スター
0
フォーク
0
平均マージ
7時間 42分
マージ済み PR(30日)
111

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

seanb4t/codegraph-go のほかの issue

seanb4t/codegraph-go の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。