跳到正文
cccskills
免费在 GitHub 公开

tests-run

Execute Unity tests (`EditMode` or `PlayMode`) and return per-test results. Supports filtering by test assembly, namespace, class, and method. Refreshes the AssetDatabase first; defers execution across domain reloads if scripts changed. Precondition: every open scene must be saved — dirty scenes abort the run.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md9.9 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Tests / Run

Execute Unity tests and return detailed results. Supports filtering by test mode, assembly, namespace, class, and method. Recommended to use 'EditMode' for faster iteration during development. Precondition: every open scene MUST be saved (no unsaved changes). If any open scene is dirty, this tool throws an InvalidOperationException listing the dirty scenes; save them and retry.

Filters

  • testMode (default EditMode) — EditMode or PlayMode. EditMode is faster; prefer it during iteration.
  • testAssembly / testNamespace / testClass / testMethod — optional, layered filters. Namespace and class filters become regex groupNames so the validation count and Unity's execution stay in sync. testMethod must be fully qualified (Namespace.FixtureName.TestName).
  • query — RQL over the tests source instead of the four filters: any selection, run as ONE Test Runner run, e.g. tests | where fixture == "PlayerTests" or categories contains "Smoke". One mode per run; the mode comes from the selected tests. Explore first with rql-query: tests | where fullName contains "Spline" | select fullName mode.
  • result — RQL stages applied to the results (source testResults: name status durationMs message stackTrace), e.g. where status == "Failed" | select name message; the answer is then a summary line plus compact RQL text.

Response toggles

  • includePassingTests (default false) — include details for passing tests; otherwise only failing test details are returned.
  • includeMessages (default true) — include per-test result messages.
  • includeStacktrace (default false) — include stack traces for failing tests.
  • includeLogs (default false) — include console logs captured during the run.
  • logType (default Warning) — minimum log severity to include.
  • includeLogsStacktrace (default false) — include log stack traces (large payload; use sparingly).

Domain reloads

If the AssetDatabase refresh triggers compilation, the tool persists the run parameters to SessionState, returns Processing, and resumes the run automatically after the reload completes. Pre-existing compilation errors short-circuit the run and return the error details so the caller can fix the project first.

How to Call

unity-mcp-cli run-tool tests-run --input '{
  "testMode": "string_value",
  "testAssembly": "string_value",
  "testNamespace": "string_value",
  "testClass": "string_value",
  "testMethod": "string_value",
  "query": "string_value",
  "result": "string_value",
  "includePassingTests": false,
  "includeMessages": false,
  "includeStacktrace": false,
  "includeLogs": false,
  "logType": "string_value",
  "includeLogsStacktrace": false
}'

For complex input (multi-line strings, code), save the JSON to a file and use:

unity-mcp-cli run-tool tests-run --input-file args.json

Or pipe via stdin (recommended):

unity-mcp-cli run-tool tests-run --input-file - <<'EOF'
{"param": "value"}
EOF

Troubleshooting

If unity-mcp-cli is not found, either install it globally (npm install -g unity-mcp-cli) or use npx unity-mcp-cli instead. Read the /unity-initial-setup skill for detailed installation instructions.

Input

NameTypeRequiredDescription
testModestringNoTest mode to run. Options: 'EditMode', 'PlayMode'. Default: 'EditMode'
testAssemblystringNoSpecific test assembly name to run (optional). Example: 'Assembly-CSharp-Editor-testable'
testNamespacestringNoSpecific test namespace to run (optional). Example: 'MyTestNamespace'
testClassstringNoSpecific test class name to run (optional). Example: 'MyTestClass'
testMethodstringNoSpecific fully qualified test method to run (optional). Example: 'MyTestNamespace.FixtureName.TestName'
querystringNoRQL over the 'tests' source selecting the tests (instead of the filters above), run as one run. Example: tests
resultstringNoRQL stages applied to the results (source 'testResults': name status durationMs message stackTrace); the answer is a summary line plus compact text. Example: where status == "Failed"
includePassingTestsbooleanNoInclude details for all tests, both passing and failing (default: false). If you just need details for failing tests, set to false.
includeMessagesbooleanNoInclude test result messages in the test results (default: true). If you just need pass/fail status, set to false.
includeStacktracebooleanNoInclude stack traces in the test results (default: false).
includeLogsbooleanNoInclude console logs in the test results (default: false).
logTypestringNoLog type filter for console logs. Options: 'Log', 'Warning', 'Assert', 'Error', 'Exception'. (default: 'Warning')
includeLogsStacktracebooleanNoInclude stack traces for console logs in the test results (default: false). This is huge amount of data, use only if really needed.

Input JSON Schema

{
  "type": "object",
  "properties": {
    "testMode": {
      "type": "string",
      "enum": [
        "EditMode",
        "PlayMode"
      ]
    },
    "testAssembly": {
      "type": "string"
    },
    "testNamespace": {
      "type": "string"
    },
    "testClass": {
      "type": "string"
    },
    "testMethod": {
      "type": "string"
    },
    "query": {
      "type": "string"
    },
    "result": {
      "type": "string"
    },
    "includePassingTests": {
      "type": "boolean"
    },
    "includeMessages": {
      "type": "boolean"
    },
    "includeStacktrace": {
      "type": "boolean"
    },
    "includeLogs": {
      "type": "boolean"
    },
    "logType": {
      "type": "string",
      "enum": [
        "Error",
        "Assert",
        "Warning",
        "Log",
        "Exception"
      ]
    },
    "includeLogsStacktrace": {
      "type": "boolean"
    }
  }
}

Output

Output JSON Schema

{
  "type": "object",
  "properties": {
    "result": {
      "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestRunResponse"
    }
  },
  "$defs": {
    "com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestSummaryData": {
      "type": "object",
      "properties": {
        "Status": {
          "type": "string",
          "enum": [
            "Unknown",
            "Passed",
            "Failed"
          ]
        },
        "TotalTests": {
          "type": "integer"
        },
        "PassedTests": {
          "type": "integer"
        },
        "FailedTests": {
          "type": "integer"
        },
        "SkippedTests": {
          "type": "integer"
        },
        "Duration": {
          "type": "string"
        }
      },
      "required": [
        "Status",
        "TotalTests",
        "PassedTests",
        "FailedTests",
        "SkippedTests",
        "Duration"
      ]
    },
    "System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestResultData)": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestResultData"
      }
    },
    "com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestResultData": {
      "type": "object",
      "properties": {
        "Name": {
          "type": "string"
        },
        "Status": {
          "type": "string",
          "enum": [
            "Passed",
            "Failed",
            "Skipped"
          ]
        },
        "Duration": {
          "type": "string"
        },
        "Message": {
          "type": "string"
        },
        "StackTrace": {
          "type": "string"
        }
      },
      "required": [
        "Status",
        "Duration"
      ]
    },
    "System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestLogEntry)": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestLogEntry"
      }
    },
    "com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestLogEntry": {
      "type": "object",
      "properties": {
        "Condition": {
          "type": "string"
        },
        "StackTrace": {
          "type": "string"
        },
        "Type": {
          "type": "string",
          "enum": [
            "Error",
            "Assert",
            "Warning",
            "Log",
            "Exception"
          ]
        },
        "Timestamp": {
          "type": "string",
          "format": "date-time"
        },
        "LogLevel": {
          "type": "integer"
        }
      },
      "required": [
        "Type",
        "Timestamp"
      ]
    },
    "com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestRunResponse": {
      "type": "object",
      "properties": {
        "Summary": {
          "$ref": "#/$defs/com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestSummaryData",
          "description": "Summary of the test run including total, passed, failed, and skipped counts."
        },
        "Results": {
          "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestResultData)",
          "description": "List of individual test results with details about each test."
        },
        "Logs": {
          "$ref": "#/$defs/System.Collections.Generic.List(com.IvanMurzak.Unity.MCP.Editor.API.TestRunner.TestLogEntry)",
          "description": "Log entries captured during test execution."
        }
      }
    }
  },
  "required": [
    "result"
  ]
}

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

build-cli

免费

Build the unity-mcp-cli TypeScript CLI tool and link it globally for terminal use.

中文简介正在准备中。当前显示原文说明。

IvanMurzak/Unity-MCP44942026年10月19日 更新

Review and resolve PR comments from GitHub. Validates each comment, fixes legitimate issues.

中文简介正在准备中。当前显示原文说明。

IvanMurzak/Unity-MCP44942026年10月19日 更新

Install a Unity package from the registry, a Git URL, or a local path. Modifies `manifest.json` and triggers package resolution; may also trigger a domain reload — the final result is delivered after the reload via the request's `requestId`. Use 'package-search' / 'package-list' for discovery first.

中文简介正在准备中。当前显示原文说明。

IvanMurzak/Unity-MCP44942026年10月19日 更新

List all UPM packages installed in the Unity project — name, version, source, description. Optionally filter by source (registry, embedded, local, git, built-in, local tarball), by name/display/description substring, and by direct-dependency-only.

中文简介正在准备中。当前显示原文说明。

IvanMurzak/Unity-MCP44942026年10月19日 更新

Uninstall a UPM package from the Unity project. Modifies `manifest.json` and may trigger a domain reload — the final result is delivered after the reload via the request's `requestId`. Built-in packages and packages that are dependencies of others cannot be removed. Use 'package-list' to list installed packages first.

中文简介正在准备中。当前显示原文说明。

IvanMurzak/Unity-MCP44942026年10月19日 更新

Search Unity's package registry plus locally installed packages (Git, local, embedded sources) by query string. Returns available versions and installation status. Online mode fetches exact matches from the live registry then supplements with cached substring matches.

中文简介正在准备中。当前显示原文说明。

IvanMurzak/Unity-MCP44942026年10月19日 更新

查看 IvanMurzak 的全部技能

报告此技能的问题