ignission / ignission/claude-code-ark
[test] パッケージ境界を越える統合テストの置き場が無い(#389 の相対 import)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2
- Forks
- 0
- Avg merge
- 1h 31m
- Merged PRs (30d)
- 77
Description
PR #389 の統合テスト packages/server/src/lib/diagram-comment-retry.integration.test.ts が、
packages/web の transport を相対パスで import している。
import { ... } from "../../../web/src/lib/diagram-comment-transport.js";
CodeRabbit の指摘(#389 comment 3835430411)のとおり、workspace のパッケージ境界を越えている。
なぜそうなったか
このテストは「実 transport(web)と実 handler(server)を結合し、ACK を落として再送が冪等になること」を
検証する。本質的にパッケージをまたぐテストで、どちらの package に置いても境界を越える。
リポジトリには前例が無い。
- web → server の相対 import: 0 件
- server → web の相対 import: 本 PR のみ
- ルートの
e2e/は Playwright 用で、vitest の統合テスト層は無い
リスク
packages/webのディレクトリ構成変更で server のテストが壊れるsocket.io-clientの型解決が web の node_modules に暗黙依存する- server の tsconfig(
lib: ["ES2023"])と web(domあり)で型チェック結果が異なりうる
対応案
- workspace レベルの統合テスト層を作る(
integration/など)。vitest の project 設定で
両 package を解決できるようにする。今後も同種のテストが増えるなら本命 @ark/webにexportsを足して server の devDependency にする。Vite アプリに
exportsを持たせる不自然さがある- transport の純粋ロジック(タイムアウトと再送)を
@ark/sharedへ移す。
プロダクション構成をテスト都合で変えることになる
1 を推す。 ただし #389 の本質(冪等性)とは独立した構造の話なので、#389 はテストを
現状の配置のままマージし、この Issue で配置を直す。
現状の検出力
配置の問題であって検出力の問題ではない。LRU の記録を無効化すると 2/2 が失敗することを
確認済み(#389 の PR 本文参照)。
Contributor guide
No contributing guide indexed for this repository
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.
Research direction
Start with packages/server/src/lib/diagram-comment-retry.integration.test.ts and the repository's package and TypeScript configuration; compare these with the root e2e/ setup. Design the workspace-level integration-test layer proposed in the issue, including Vitest project resolution for both packages. Done means the test no longer crosses the package boundary with a relative import and still verifies the existing integration behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- build-system, testing
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100