You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Server~/build/tools/runTestsTool.js
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -5,8 +5,9 @@ const toolName = 'run_tests';
5
5
consttoolDescription='Runs Unity\'s Test Runner tests';
6
6
constparamsSchema=z.object({
7
7
testMode: z.string().optional().default('EditMode').describe('The test mode to run (EditMode or PlayMode) - defaults to EditMode (optional)'),
8
-
testFilter: z.string().optional().default('').describe('The specific test filter to run (e.g. specific test name or namespace) (optional)'),
9
-
returnOnlyFailures: z.boolean().optional().default(true).describe('Whether to show only failed tests in the results (optional)')
8
+
testFilter: z.string().optional().default('').describe('The specific test filter to run (e.g. specific test name or class name, must include namespace) (optional)'),
9
+
returnOnlyFailures: z.boolean().optional().default(true).describe('Whether to show only failed tests in the results (optional)'),
10
+
returnWithLogs: z.boolean().optional().default(false).describe('Whether to return the test logs in the results (optional)')
10
11
});
11
12
/**
12
13
* Creates and registers the Run Tests tool with the MCP server
@@ -41,14 +42,15 @@ export function registerRunTestsTool(server, mcpUnity, logger) {
41
42
* @throws McpUnityError if the request to Unity fails
Copy file name to clipboardExpand all lines: Server~/src/tools/runTestsTool.ts
+7-4Lines changed: 7 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -10,8 +10,9 @@ const toolName = 'run_tests';
10
10
consttoolDescription='Runs Unity\'s Test Runner tests';
11
11
constparamsSchema=z.object({
12
12
testMode: z.string().optional().default('EditMode').describe('The test mode to run (EditMode or PlayMode) - defaults to EditMode (optional)'),
13
-
testFilter: z.string().optional().default('').describe('The specific test filter to run (e.g. specific test name or namespace) (optional)'),
14
-
returnOnlyFailures: z.boolean().optional().default(true).describe('Whether to show only failed tests in the results (optional)')
13
+
testFilter: z.string().optional().default('').describe('The specific test filter to run (e.g. specific test name or class name, must include namespace) (optional)'),
14
+
returnOnlyFailures: z.boolean().optional().default(true).describe('Whether to show only failed tests in the results (optional)'),
15
+
returnWithLogs: z.boolean().optional().default(false).describe('Whether to return the test logs in the results (optional)')
15
16
});
16
17
17
18
/**
@@ -56,7 +57,8 @@ async function toolHandler(mcpUnity: McpUnity, params: any = {}): Promise<CallTo
56
57
const{
57
58
testMode ='EditMode',
58
59
testFilter ='',
59
-
returnOnlyFailures =true
60
+
returnOnlyFailures =true,
61
+
returnWithLogs =false
60
62
}=params;
61
63
62
64
// Create and wait for the test run
@@ -65,7 +67,8 @@ async function toolHandler(mcpUnity: McpUnity, params: any = {}): Promise<CallTo
0 commit comments