-
Notifications
You must be signed in to change notification settings - Fork 115
feat: added param:returnWithLogs for run_tests, count pass/fail with valid tests only #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -10,8 +10,9 @@ const toolName = 'run_tests'; | |||||||||||||||||||
const toolDescription = 'Runs Unity\'s Test Runner tests'; | ||||||||||||||||||||
const paramsSchema = z.object({ | ||||||||||||||||||||
testMode: z.string().optional().default('EditMode').describe('The test mode to run (EditMode or PlayMode) - defaults to EditMode (optional)'), | ||||||||||||||||||||
testFilter: z.string().optional().default('').describe('The specific test filter to run (e.g. specific test name or namespace) (optional)'), | ||||||||||||||||||||
returnOnlyFailures: z.boolean().optional().default(true).describe('Whether to show only failed tests in the results (optional)') | ||||||||||||||||||||
testFilter: z.string().optional().default('').describe('The specific test filter to run (e.g. specific test name or class name, must include namespace) (optional)'), | ||||||||||||||||||||
returnOnlyFailures: z.boolean().optional().default(true).describe('Whether to show only failed tests in the results (optional)'), | ||||||||||||||||||||
returnWithLogs: z.boolean().optional().default(false).describe('Whether to return the test logs in the results (optional)') | ||||||||||||||||||||
}); | ||||||||||||||||||||
Comment on lines
+13
to
16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same default mismatch as in JS build artifact Align the TypeScript source with the Editor default to avoid accidental filtering. - returnOnlyFailures: z.boolean().optional().default(true)
+ returnOnlyFailures: z.boolean().optional().default(false) 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||||
|
||||||||||||||||||||
/** | ||||||||||||||||||||
|
@@ -56,7 +57,8 @@ async function toolHandler(mcpUnity: McpUnity, params: any = {}): Promise<CallTo | |||||||||||||||||||
const { | ||||||||||||||||||||
testMode = 'EditMode', | ||||||||||||||||||||
testFilter = '', | ||||||||||||||||||||
returnOnlyFailures = true | ||||||||||||||||||||
returnOnlyFailures = true, | ||||||||||||||||||||
returnWithLogs = false | ||||||||||||||||||||
} = params; | ||||||||||||||||||||
|
||||||||||||||||||||
// Create and wait for the test run | ||||||||||||||||||||
|
@@ -65,7 +67,8 @@ async function toolHandler(mcpUnity: McpUnity, params: any = {}): Promise<CallTo | |||||||||||||||||||
params: { | ||||||||||||||||||||
testMode, | ||||||||||||||||||||
testFilter, | ||||||||||||||||||||
returnOnlyFailures | ||||||||||||||||||||
returnOnlyFailures, | ||||||||||||||||||||
returnWithLogs | ||||||||||||||||||||
} | ||||||||||||||||||||
}); | ||||||||||||||||||||
|
||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default for
returnOnlyFailures
diverges from Editor defaultHere the schema defaults
returnOnlyFailures
totrue
, while the Editor tool falls back tofalse
.With no explicit user input, the server will always request only failures, changing behaviour unexpectedly after this PR.
🤖 Prompt for AI Agents