Skip to content

Add terminal-driven E2E coverage for v3 CLI recovery and readiness #1137

@hatayama

Description

@hatayama

Background

v3 now relies on the native CLI, project-local IPC, and readiness/recovery state files. Unit tests and focused Unity tests cover the state model, but we still need a repeatable end-to-end test that runs from outside Unity like a real user command.

This should follow the v3 direction: terminal-driven E2E, not long-running Unity EditMode tests that block the editor thread.

Goal

  • Verify that CLI commands recover reliably after Unity startup, compile/domain reload, and server recovery.
  • Verify that the CLI does not wait forever when readiness state is stale or failed.
  • Keep the test usable locally and in CI-like environments without depending on ambient editor scene state.

Candidate Tasks

  • Add a POSIX-friendly E2E harness under scripts/ that runs real uloop commands against a target Unity project with --project-path.
  • Cover at least: readiness check, compile --wait-for-domain-reload, immediate get-logs, and execute-dynamic-code after recovery.
  • Add stale recovery-state coverage that proves the CLI exits with actionable guidance instead of waiting until timeout.
  • Decide whether to extend scripts/smoke-compile-get-logs.py, add a new recovery-specific script, or integrate into the existing terminal-driven E2E helpers.
  • Document how to run the E2E locally, including any Unity/Test Framework/Input System prerequisites.

Acceptance Criteria

  • The E2E launches or reuses the intended Unity project and never starts duplicate Unity instances for the same project.
  • Every uloop invocation passes an explicit --project-path.
  • The test owns required scene/setup preconditions instead of relying on the currently open scene.
  • The test has bounded timeouts and prints enough stdout/stderr/state context to diagnose failures.
  • The test avoids Unity EditMode patterns known to freeze the editor: no main-thread blocking waits, no long-lived background tasks inside Unity tests, and no nested test runner orchestration.
  • The final command sequence passes on the v3 branch with the checked-in native CLI binary.

Related Context

  • PR fix: CLI commands recover reliably after Unity reloads #1136 adds state-file readiness and recovery handling for domain reload/startup/compile flows.
  • Existing helpers include scripts/smoke-compile-get-logs.py, scripts/smoke-uloop-launch.py, and scripts/run-windows-e2e.ps1.
  • v2 had integrated CLI E2E coverage; v3 should keep the spirit but prefer terminal-driven coverage around the native CLI contract.

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