Skip to content

feat: test runner and ScriptableObject commands (v2.2.0) - #16

Merged
niqibiao merged 2 commits into
mainfrom
feat/test-run-and-scriptableobject
Aug 18, 2026
Merged

niqibiao merged 2 commits into
mainfrom
feat/test-run-and-scriptableobject

Conversation

@niqibiao

Copy link
Copy Markdown
Owner

Adds two capability groups to the command surface and bumps the package to 2.2.0.

Test runner — editor/test.run, editor/test.status

Drives the Unity Test Framework through TestRunnerApi. test.run starts an
EditMode or PlayMode run with optional testNames/groupNames filters and
returns a run id; test.status reports the phase and the structured result
(counts, duration, and up to 25 failures with truncated messages).

Two details worth review attention:

  • The commands stay registered when com.unity.test-framework is absent.
    The CLI's overlay validation requires strict overlay↔registry equality, so
    conditional registration would break discovery in projects without the
    framework. Instead an asmdef versionDefines entry gates the
    implementation, and the absent case returns an explanatory validation error.
  • The run record lives in Library/CSharpConsole/test_run_state.json. The
    editor recreates Temp/ on every start, so a record kept there could never
    survive to report an interrupted run as aborted. A SessionState sentinel
    distinguishes "still running in this session" from "the editor restarted
    mid-run", and [InitializeOnLoadMethod] re-registers the callbacks after
    each domain reload.

ScriptableObject authoring — scriptableobject/create|get|modify

Creates SO assets by type name and reads/writes their serialized fields via
SerializedObject, following the existing material command idiom. Save paths
must sit under Assets/ and end in .asset; the type must be a concrete
ScriptableObject.

Also

  • READMEs state the trusted-LAN service model explicitly: the service binds all
    interfaces without authentication by design and must not be exposed to
    untrusted networks.
  • Command tables and counts updated; the previously documented 57 was wrong —
    the registry holds 56 (51 authoring + 5 control), now 61 with these five.

Validation

Live-tested on two projects, including one using HybridCLR/IL2CPP: editor
compile, full EditMode suite, PlayMode run, and a Windows IL2CPP development
build. The build confirms the new asmdef TestRunner references do not reach
the player (ScriptingAssemblies.json carries no TestRunner/NUnit), the
runtime service starts and answers commands, and the editor-only commands are
correctly absent in the player.

🤖 Generated with Claude Code

niqibiao and others added 2 commits August 16, 2026 11:58
- editor/test.run starts a Unity Test Framework run (EditMode or PlayMode)
  and editor/test.status reports the latest run with structured results;
  state survives domain reloads via Temp/CSharpConsole/test_run_state.json
  and editor restarts are reported as aborted via a SessionState flag.
- The commands stay registered without com.unity.test-framework and return
  an explanatory error, keeping the registry uniform for discovery; the
  optional dependency is gated by an asmdef versionDefine.
- scriptableobject/create|get|modify manage ScriptableObject assets by type
  name and serialized fields, mirroring the material/component patterns.
- READMEs document the new commands (61 built-ins across 14 namespaces)
  and state the trusted-LAN service model explicitly.
- Version 2.2.0 (additive; protocol stays 1).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The editor recreates Temp on every start, so a run interrupted by a crash
or quit lost its record and reported idle instead of aborted. Library
survives restarts, making the orphaned-run reconciliation reachable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@niqibiao
niqibiao merged commit f380067 into main Aug 18, 2026
1 check passed
@niqibiao
niqibiao deleted the feat/test-run-and-scriptableobject branch August 18, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant