Skip to content

[test] TUI profile 昇格のポート fixture を test transport に移す #633

Closed

Description

@Kewton

親 Issue:#541(分割案 N、2026-10-09 起票。I は #620、M は #608 で merge 済み)

背景

integration test は通常ビルドの library を使うため、M の cfg(test) hook をそのまま呼べない。対象は FakeUi と fake provider を使う profile 昇格 1 body で、実 PTY を起動するテストではない。

元 Issue 541 の第 4 群を扱う。調査基準は fetch 済み develop の f8ce541。失敗を再現済みという意味ではない。

対象ファイル

  • tests/tui_integration.rs
  • tests/support/tui_profile_fixture.rs(新規)
  • src/tui/mod.rs
  • src/tui/profile_transport_tests.rs(新規)

直し方

  • port を使う 1 body を同じ library 呼出しと assertion のまま必須の lib test module に移し、M の test transport を利用する。モジュール配線は tui の親へ置く。
  • Config、FakeClient、FakeUi、workspace 生成などの必要な共通 fixture だけを test support に抽出し、元の integration からも同じものを使う。大量の helper をコピーしない。
  • child の bind 0、ready、HTTP、process cleanup を実際に行う。goal、profile 昇格、terminal summary、stage、証跡の判定を保存し、cfg(test) で probe が disabled になったまま合格することを禁止する。
  • 通常 library や release binary にテスト環境変数の入口を作らない。残る integration tests と PTY tests は通常の library と binary を引き続き検証する。

受け入れ条件

  • 旧 body と新 body の assertion 対応が 1 対 1。test の数を減らさず、新 body が通常の cargo test で必ず実行される。
  • 旧来の番号解放 helper が不要になり、論理ポート占有と 2 checkout 同時実行でも同じ profile 昇格・summary を確認する。
  • 実子が起動し HTTP を観測した証拠があり、単なる scripted availability や disabled outcome で pass しない。
  • 全 TUI integration と新 lib test が通り、公開 API と製品既定値に差分がない。

検証

  • cargo test --test tui_integration
  • cargo test --lib tui::profile_transport_tests
  • cargo fmt --all -- --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test

依存と規模

先行条件: I と M の後。Issue 518 の TUI 動作を統合後に再確認。

移す test 1、抽出する fixture 8〜15、配線 1。移動込み変更 450〜750 行、純増 50〜130 行。機械抽出が主体だが本案は後段で単独レビューする。

テスト移動は設計判断を伴う。元の通常 library 専用の assertion が見つかった場合は移動せず leader に設計差分を返す。cfg(test) hook を release へ露出する代案は不可。

共通制約

  • 製品の timeout 既定値、イベント名と schema、判定理由、検証・受入・証跡ゲートを緩めない。timeout 許容、成功までの再実行、未実行を pass とする扱いは禁止する。
  • 無期限 wait を作らず、失敗時も子・thread・pipe を回収する。ready は対象実行の合図に拘束する。
  • 既存の corpus 契約、recovery 契約、歴史的証跡、live runtime namespace は変更しない。本案は transport または test timing の修正であり、契約を変える必要が生じたら別途 scope を見直す。
  • 同時実行の確認は将来の検証計画である。現時点の「build は 1 本ずつ」に従い、実行可能ファイルを逐次準備する。2 checkout の同時 test、ポート占有、実 PTY の実験はその枠を leader と調整してから行う。

根拠

  • tests/tui_integration.rs:568
  • tests/tui_integration.rs:646
  • tests/tui_integration.rs:658
  • tests/tui_integration.rs:1051
  • src/tui/mod.rs
  • src/planner/runner/acceptance.rs:406

参照

  • docs/dev/dev-guardrails.md
  • tests/generality_guardrails.rs
  • workspace/tmp/0928/parallel-537/results/H-01/report.md

関連(参考)

Activity

  1. added a commit that references this issue on Oct 9, 2026
  2. Kewton commented on Oct 9, 2026

    @Kewton
    OwnerAuthor

    PR #640 で develop に merge しました(merge commit 66fbb07、CI・acceptance・Next.js domain oracles success)。TUI の profile 昇格のテストを lib に移し、#608 の test transport の約束で実ポートを使うようにしました(#541 の分割案 N)。共有の状態の取り合いを避けるため、移したテストは子プロセスで 1 本だけ走らせます(tui:: を 20 回で 0/20)。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions