unity-test
Test Skills
Run and manage Unity tests.
Guardrails
Mode: Full-Auto required
DO NOT (common hallucinations):
test_run_alldoes not exist → usetest_runortest_run_by_nametest_create_templatedoes not exist → usetest_create_editmodeortest_create_playmodetest_get_statusdoes not exist → usetest_get_resultwithjobIdfrom test run- Test skills are async — they return a
jobId, poll withtest_get_result(jobId) - Unity Test Runner is serialized here: do not start a second
test_runwhile another test job is still active - Prefer
unity_skills.get_skills(category="Test")orGET /skills/schemafor exact signatures instead of guessing from memory
Routing:
- For compile error checking → use
debugmodule'sdebug_check_compilation - For test script creation →
test_create_editmode/test_create_playmode, then modify viascriptmodule - For broad regression probes across many skills →
test_smoke_skills, which uses transient probes to avoid polluting workflow/batch persistence
Skills
test_list
List available tests. Parameters:
testMode(string, optional): EditMode or PlayMode. Default: EditMode.limit(int, optional): Max tests to list. Default: 100.
test_run
Run Unity tests (returns job ID for polling). Parameters:
testMode(string, optional): EditMode or PlayMode. Default: EditMode.filter(string, optional): Test name filter.
test_get_result
Get the result of a test run. Parameters:
jobId(string): Job ID from test_run.
Returns: { success, jobId, status, totalTests, passedTests, failedTests, skippedTests, inconclusiveTests, otherTests, failedTestNames, elapsedSeconds, resultSummary, error }
test_cancel
Cancel a running test. Parameters:
jobId(string, optional): Job ID to cancel.
test_run_by_name
Run specific tests by class or method name.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| testName | string | Yes | - | Test class or method name to run |
| testMode | string | No | EditMode | EditMode or PlayMode |
Returns: { success, jobId, testName, testMode }
test_get_last_result
Get the most recent test run result.
No parameters.
Returns: { jobId, status, total, passed, failed, skipped, inconclusive, other, failedNames }
test_list_categories
List test categories.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| testMode | string | No | EditMode | EditMode or PlayMode |
Returns: { success, count, categories }
test_smoke_skills
Run a reusable smoke test across registered skills.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| category | string | No | - | Only test one skill category |
| nameContains | string | No | - | Filter skills by partial name |
| excludeNamesCsv | string | No | - | Comma-separated skill names to exclude |
| executeReadOnly | bool | No | true | Execute safe read-only skills directly |
| includeMutating | bool | No | true | Include mutating skills via dryRun smoke testing |
| limit | int | No | 0 | Max skills to inspect; 0 means all |
Returns: { success, totalSkills, executedCount, dryRunCount, failureCount, results }
test_create_editmode
Create an EditMode test script template.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| testName | string | Yes | - | Name of the test class to create |
| folder | string | No | Assets/Tests/Editor | Folder path for the test script |
Returns: { success, path, testName, serverAvailability }
test_create_playmode
Create a PlayMode test script template.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| testName | string | Yes | - | Name of the test class to create |
| folder | string | No | Assets/Tests/Runtime | Folder path for the test script |
Returns: { success, path, testName, serverAvailability }
test_get_summary
Get aggregated test summary across all runs.
No parameters.
Returns: { success, totalRuns, completedRuns, totalPassed, totalFailed, totalSkipped, totalInconclusive, totalOther, allFailedTests }
Minimal Example
import unity_skills, time
# Run tests and poll for result (async pattern required)
result = unity_skills.call_skill("test_run", testMode="EditMode")
job_id = result["jobId"]
# Poll until done (test_* skills are async)
for _ in range(30):
status = unity_skills.call_skill("test_get_result", jobId=job_id)
if status.get("status") == "Completed":
print(f"Passed: {status['totalPassed']}, Failed: {status['totalFailed']}")
break
time.sleep(2)
Exact Signatures
Exact names, parameters, defaults, and returns are defined by GET /skills/schema or unity_skills.get_skill_schema(), not by this file.
More from besty0728/unity-skills
unity-skills
Unity Editor automation via REST API — create scripts, analyze scenes, manage assets, control editor, and orchestrate workflows. Triggers: Unity, Unity Skills, in Unity, automate Unity, editor automation, create script, scene summary, build scene, 全自动模式, full auto, semi-auto, 半自动, Unity自动化, Unity编辑器, Unity技能, 操作Unity,在Unity中.
56unity-uitoolkit
UI Toolkit (UITK) for Unity — create/edit USS stylesheets and UXML layouts, configure UIDocument in scenes. Triggers: UI Toolkit, UITK, UXML, USS, UIDocument, PanelSettings, VisualElement, stylesheet, runtime UI, EditorWindow UI, 界面工具包, UI样式, 样式表, 可视化元素.
22unity-ui
Unity UI creation. Use when users want to create Canvas, Button, Text, Image, or other UI elements. Triggers: UI, canvas, button, text, image, panel, slider, toggle, UGUI, 界面, 按钮, 文本, 面板.
20unity-scriptableobject
ScriptableObject management. Use when users want to create, read, or modify ScriptableObject assets. Triggers: scriptableobject, SO, data asset, config, settings asset, 数据资产, 配置文件.
19unity-editor
Unity Editor control. Use when users want to enter play mode, select objects, undo/redo, or execute menu commands. Triggers: play, stop, pause, select, undo, redo, menu, editor, Unity编辑器, Unity播放, Unity撤销, Unity选择.
18unity-light
Unity lighting control. Use when users want to create or configure lights (Directional, Point, Spot, Area). Triggers: light, lighting, directional light, point light, spot light, shadows, intensity, 灯光, 光照, 阴影.
17