Engineering
unity-test-runner avatar

unity-test-runner

Execute and analyze Unity Test Framework tests from the CLI. Automates Unity Editor detection, test execution (EditMode/PlayMode), XML result parsing, and detailed failure reporting for game projects.

Introduction

The Unity Test Runner is a specialized skill designed to streamline the quality assurance process for Unity game development directly from the command line. This tool serves Unity developers and engineers who need to integrate automated testing into their local workflows or CI/CD pipelines. By automating the entire test lifecycle, it reduces manual friction associated with opening the Unity Editor GUI for repetitive test cycles. It is particularly effective for validating game logic, debugging regressions, and ensuring project stability before commits.

  • Automatically detects Unity Editor installations across Windows, macOS, and Linux platforms, including support for multiple Unity versions.

  • Executes tests in either EditMode or PlayMode, allowing for fast unit testing or comprehensive engine-level integration testing.

  • Supports advanced test filtering and categorization, enabling developers to run specific subsets of tests such as Combat, AI, or Physics modules.

  • Parses NUnit-compatible XML results generated by the Unity Test Framework to provide structured summary statistics and failure diagnostics.

  • Generates detailed, actionable failure reports including full stack traces, source file locations, and line numbers to pinpoint errors rapidly.

  • Integrates seamlessly into shell-based workflows using standard command-line flags for project paths, log file outputs, and test result exports.

  • Always verify the presence of ProjectSettings/ProjectVersion.txt and the Assets directory before attempting execution to ensure the project path is valid.

  • Use the find-unity-editor.js script to list and select the appropriate Editor version if multiple versions are installed on the local machine.

  • Leverage the --json flag for programmatic consumption of both discovery and test analysis scripts.

  • Monitor test execution using background processes; use appropriate timeouts for long-running PlayMode tests to avoid premature termination.

  • This tool is intended for use in environments where the Unity Editor is installed locally and accessible via standard CLI paths.

Repository Stats

Stars
82
Forks
9
Open Issues
0
Language
C#
Default Branch
main
Sync Status
Idle
Last Synced
May 1, 2026, 07:05 AM
View on GitHub