Skip to content

[MEDIUM] test result parsing can attach unrelated nested messages to non-passing cases #106

Description

@Daliys

Problem

GetTestResults falls back to the first descendant <message> anywhere under a non-passing test case when no <failure><message> exists.

Evidence

  • Editor/MCPServerMethods.TestResults.cs:36-42 skips only Passed/Skipped results.
  • For other statuses, it uses testCase.Element("failure")?.Element("message")?.Value ?? testCase.Descendants("message").FirstOrDefault()?.Value.
  • The fallback is not scoped to failure/error/reason nodes.

Impact

Inconclusive, Error, or other non-passing NUnit XML shapes can surface an unrelated nested message as the failure reason, misleading callers diagnosing test failures.

Suggested fix

Scope fallback message extraction to known result containers such as failure, reason, or output, and preserve the result status when no reason exists instead of grabbing any descendant message.

Source report

Imported from audit report item: Editor/MCPServerMethods.TestResults.cs:41.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-triageImported or reported issue awaiting owner reviewpriority: mediumImportant defect or workflow gap with workaroundsurface: testsTest runner, test windows, or verification helperssurface: unity-editorUnity Editor package, windows, menus, or C# server surfacetype: correctnessIncorrect result, bad validation, or misleading success/failure behavior

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions