Files
hakorune/docs/development/current/main/phases/phase-287/P1-INSTRUCTIONS.md
tomoaki 4cc324c06e smokes(v2): Slim quick profile (Phase 287 P1)
Phase 287 P1 completed: Quick profile optimization

Changes:
- Moved 204 heavy tests from quick to integration profile
- Reduced execution time: 449.1s → 55.0s (88% reduction)
- Reduced test count: 651 → 447 tests (31% reduction)
- Maintained relative path structure for --filter compatibility

Moved test directories (14 total):
- phase2100, phase2211, phase2120, phase2220, phase251
- phase2160, phase2047-2051 (7 dirs), analyze

Profile responsibilities:
- quick: Fast feedback (55s, 447 tests)
- integration: Comprehensive validation (selfhost, S3, LLVM)

Documentation updates:
- tools/smokes/v2/README.md: Profile definitions
- docs/development/current/main/phases/phase-287/README.md: P1 results

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-25 07:48:18 +09:00

3.6 KiB
Raw Blame History

Phase 287 P1: スモークテストquick軽量化 — 作業指示書

目的P1のゴール

  • tools/smokes/v2/run.sh --profile quick を「開発中に気軽に回せる速さ」に戻す。
  • 既定挙動・意味論は不変(テストの配置/分類の変更のみ)。

成功条件(受け入れ基準)

  • --profile quick45秒以内(目安)で完走する。
  • quick のテスト本数は ~100本以下(目安)。
  • 重い/環境依存のケースは integration/fullまたは pluginsへ移し、quick には残さない。
  • --filter の導線を壊さない(パス階層は可能な限り維持する)。

方針(設計)

  • 現状: quick 配下に *.sh651本あり、run.sh はディレクトリ全探索で全て実行している。
  • 解決: quick の責務を「最小ゲート」に再定義し、重いテストを profile 間で責務分離する。
    • quick: 入口導線using最小の制御/型/演算+最小 selfhost 1本必要なら
    • integration: selfhost/Stage-B 系、長尺、S3/LLVM 連携、crate-exe 等の重いもの
    • full: 網羅(広い回帰)
    • plugins: プラグイン依存(動的ロード検証など)

手順(推奨の進め方)

1) 計測(現状の遅さを「どれが遅いか」に分解)

./tools/smokes/v2/measure_test_times.sh quick /tmp/smoke_test_times_quick.txt
head -50 /tmp/smoke_test_times_quick.txt.sorted

ここで「遅いファミリー」を把握する(例: phase2100/*, selfhost_*, s3_*, crate EXE 系など)。

2) quick に残す最小セットを決める(まず削る)

優先して quick に残す候補(あくまで例。実際は計測結果に合わせて調整):

  • using 解決の最小ケースnamed / relative
  • 入口の --backend vm 実行(最小の .hako
  • if/loop/return の最小
  • Stage-B/selfhost は 最小1本に絞る(必要なら)

P1では「網羅」より「速さ」を優先するintegration/full が網羅担当)。

3) 重いテストを integration/full に移す(構造的に解決)

  • 原則 git mv で移動する。
  • 相対パスの階層は維持する(例: core/phase2100/...profiles/integration/core/phase2100/... に移す)。
    • これにより --filter 'phase2100/...' の使い勝手が保たれる。

例(方針イメージ):

git mv tools/smokes/v2/profiles/quick/core/phase2100 tools/smokes/v2/profiles/integration/core/
git mv tools/smokes/v2/profiles/quick/core/phase251  tools/smokes/v2/profiles/integration/core/

注意:

  • 既存の tools/smokes/v2/README.md にある通り、StageB/selfhost canary 群は quick には不向き。
  • まず「ディレクトリ単位で移動」→ 速くなる → その後に例外だけ戻す、の順で行う。

4) quick の再計測(差分の確認)

time ./tools/smokes/v2/run.sh --profile quick
./tools/smokes/v2/measure_test_times.sh quick /tmp/smoke_test_times_quick_after.txt

5) ドキュメント更新SSOTを合わせる

  • tools/smokes/v2/README.md: quick / integration / full の責務と目安(秒・本数)を明記。
  • docs/development/current/main/phases/phase-287/README.md: P1の結果before/after の秒・本数)を追記。

追加の注意(やらないこと)

  • P1では「並列実行--jobs」の実装改修には入らない別フェーズで
  • テストロジックのハードコードや by-name 分岐はしないprofile の責務分離で解決する)。