Back to Unity Mcp

run_tests

website/docs/reference/tools/testing/run_tests.md

9.7.11.6 KB
Original Source

run_tests

Auto-generated from the Python tool registry. Do not hand-edit outside <!-- examples:start --><!-- examples:end --> blocks — the generator (tools/generate_docs_reference.py) will overwrite them.

Group: testing  ·  Module: services.tools.run_tests

Description

Starts a Unity test run asynchronously and returns a job_id immediately. Poll with get_test_job for progress.

Parameters

NameTypeRequiredDescription
modeLiteral['EditMode', 'PlayMode']Unity test mode to run
test_nameslist[str] | str | NoneFull names of specific tests to run
group_nameslist[str] | str | NoneSame as test_names, except it allows for Regex
category_nameslist[str] | str | NoneNUnit category names to filter by
assembly_nameslist[str] | str | NoneAssembly names to filter tests by
include_failed_testsboolInclude details for failed/skipped tests only (default: false)
include_detailsboolInclude details for all tests (default: false)
init_timeoutint | NoneInitialization timeout in milliseconds. PlayMode tests may need longer due to domain reload (default: 15000). Recommended: 120000 for PlayMode.

Returns

A dict containing the Unity response. The exact shape depends on the action.

Examples

<!-- examples:start -->

No examples yet. Add usage examples here — they will be preserved across regenerations.

<!-- examples:end -->