ignission / ignission/claude-code-ark

[test] パッケージ境界を越える統合テストの置き場が無い(#389 の相対 import)

Open
#390 0 comments 0 reactions 0 assignees View on GitHub

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 あり)で型チェック結果が異なりうる

対応案

  1. workspace レベルの統合テスト層を作るintegration/ など)。vitest の project 設定で
    両 package を解決できるようにする。今後も同種のテストが増えるなら本命
  2. @ark/webexports を足して server の devDependency にする。Vite アプリに
    exports を持たせる不自然さがある
  3. transport の純粋ロジック(タイムアウトと再送)を @ark/shared へ移す。
    プロダクション構成をテスト都合で変えることになる

1 を推す。 ただし #389 の本質(冪等性)とは独立した構造の話なので、#389 はテストを
現状の配置のままマージし、この Issue で配置を直す。

現状の検出力

配置の問題であって検出力の問題ではない。LRU の記録を無効化すると 2/2 が失敗することを
確認済み(#389 の PR 本文参照)。

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.