Skip to content
Development
Skill

/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

From plugin
ivanmurzak-unity-mcp
3.8k80 skills
Install
$ npx -y skills add IvanMurzak/Unity-MCP --skill tests-run --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/tests-run

Context preview

The summary Claude sees to decide when to auto-load this skill.

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

SKILL.md

tests-run.SKILL.md
name: tests-run
description: "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."

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`).

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",
  "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: > ```bash > unity-mcp-cli run-tool tests-run --input-file args.json > ``` > > Or pipe via stdin (recommended): > ```bash > 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

| Name | Type | Required | Description | |------|------|----------|-------------| | `testMode` | `string` | No | Test mode to run. Options: 'EditMode', 'PlayMode'. Default: 'EditMode' | | `testAssembly` | `string` | No | Specific test assembly name to run (optional). Example: 'Assembly-CSharp-Editor-testable' | | `testNamespace` | `string` | No | Specific test namespace to run (optional). Example: 'MyTestNamespace' | | `testClass` | `string` | No | Specific test class name to run (optional). Example: 'MyTestClass' | | `testMethod` | `string` | No | Specific fully qualified test method to run (optional). Example: 'MyTestNamespace.FixtureName.TestName' | | `includePassingTests` | `boolean` | No | Include details for all tests, both passing and failing (default: false). If you just need details for failing tests, set to false. | | `includeMessages` | `boolean` | No | Include test result messages in the test results (default: true). If you just need pass/fail status, set to false. | | `includeStacktrace` | `boolean` | No | Include stack traces in the test results (default: false). | | `includeLogs` | `boolean` | No | Include console logs in the test results (default: false). | | `logType` | `string` | No | Log type filter for console logs. Options: 'Log', 'Warning', 'Assert', 'Error', 'Exception'. (default: 'Warning') | | `includeLogsStacktrace` | `boolean` | No | Include 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"
    },
    "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": {
Read more
Ships withivanmurzak-unity-mcp

Get up and running in three steps: Install plugin — download the .unitypackage installer or run openupm add com.ivanmurzak.unity.mcp Alternative: npx unity-mcp-cli install-plugin ./MyUnityProject — see CLI documentation Pick an AI agent — Claude Code, Claude

Get the whole plugin
Stats
3,845
Stars
349
Forks
Active
Maintenance
C#
Language
Apache-2.0
License
12h ago
Last commit
1y ago
Created

Repo: IvanMurzak/Unity-MCP