Skip to content

[tests] Show full test names in html failure reports.#25094

Open
rolfbjarne wants to merge 2 commits intomainfrom
dev/rolf/tests-full-name
Open

[tests] Show full test names in html failure reports.#25094
rolfbjarne wants to merge 2 commits intomainfrom
dev/rolf/tests-full-name

Conversation

@rolfbjarne
Copy link
Copy Markdown
Member

No description provided.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates xharness’ Jenkins HTML failure report generation to surface full test names by parsing structured test result files (TRX / NUnit XML) and rendering failed test lists directly in the HTML report.

Changes:

  • Adds a structured-results parsing path to HTML reports (TRX + NUnit XML) and renders failed test names/messages as HTML list items.
  • Extends the shared TRX parser utility to also parse NUnit XML files for failed tests.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
tests/xharness/Jenkins/Reports/HtmlReportWriter.cs Detects structured result logs, attempts to render structured failure lists into the HTML report, and suppresses the legacy [FAIL] extraction in some cases.
tests/common/ParseTrxFile.cs Adds TryParseNUnitXmlFile to extract failed tests (with full names when available) from NUnit XML result files.

ThenBy (v => v.FullPath);
ThenBy (v => v.FullPath).
ToList ();
var hasStructuredTestResults = query.Any (v => (v.Description == LogType.NUnitResult.ToString () || v.Description == LogType.XmlLog.ToString () || v.Description == LogType.TrxLog.ToString ()) && File.Exists (v.FullPath) && new FileInfo (v.FullPath).Length > 0);
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hasStructuredTestResults is computed purely from the presence of a non-empty structured results file, and is then used to suppress the [FAIL] lines from the execution/test log. If the structured results file exists but is malformed/unparseable (so neither TryWriteStructuredTestReport nor resultParser.GenerateTestReport emits anything), this will hide the fallback failure list and can leave the HTML report with no failure details. Consider driving this condition off whether a structured report was actually successfully written (e.g., set a flag when parsing succeeds), or only suppress the fallback once hasListedErrors becomes true.

Suggested change
var hasStructuredTestResults = query.Any (v => (v.Description == LogType.NUnitResult.ToString () || v.Description == LogType.XmlLog.ToString () || v.Description == LogType.TrxLog.ToString ()) && File.Exists (v.FullPath) && new FileInfo (v.FullPath).Length > 0);
var hasStructuredTestResults = false;

Copilot uses AI. Check for mistakes.
Comment on lines +115 to +116
if (outcome is null)
outcome = rv.Count > 0 ? "Failed" : "Passed";
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When outcome is missing in the NUnit XML and there are no failed tests, the method sets outcome to "Passed" (line 115-116) but leaves allTestsSucceeded as false. This makes allTestsSucceeded inconsistent with the computed outcome and can mislead callers that rely on the flag. Set allTestsSucceeded = (rv.Count == 0) when defaulting the outcome, or otherwise derive it from rv when outcome is null/empty.

Suggested change
if (outcome is null)
outcome = rv.Count > 0 ? "Failed" : "Passed";
if (outcome is null) {
outcome = rv.Count > 0 ? "Failed" : "Passed";
allTestsSucceeded = rv.Count == 0;
}

Copilot uses AI. Check for mistakes.
@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [CI Build #21cf5a1] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 21cf5a1b2af8c7f9ced4c6f35dec39608ce693dc [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [PR Build #21cf5a1] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 21cf5a1b2af8c7f9ced4c6f35dec39608ce693dc [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 21cf5a1b2af8c7f9ced4c6f35dec39608ce693dc [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne rolfbjarne enabled auto-merge (squash) April 6, 2026 13:09
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [CI Build #21cf5a1] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 21cf5a1b2af8c7f9ced4c6f35dec39608ce693dc [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

🚀 [CI Build #21cf5a1] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 156 tests passed 🎉

Tests counts

✅ cecil: All 1 tests passed. [attempt 4] Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. [attempt 3] Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. [attempt 3] Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. [attempt 4] Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ framework: All 2 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ generator: All 5 tests passed. [attempt 4] Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 6 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. [attempt 3] Html Report (VSDrops) Download
✅ monotouch (iOS): All 11 tests passed. [attempt 5] Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 12 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 11 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Monterey (12): All 5 tests passed. [attempt 3] Html Report (VSDrops) Download
✅ Tests on macOS Ventura (13): All 5 tests passed. [attempt 3] Html Report (VSDrops) Download
✅ Tests on macOS Sonoma (14): All 5 tests passed. [attempt 3] Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. [attempt 3] Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. [attempt 3] Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: 21cf5a1b2af8c7f9ced4c6f35dec39608ce693dc [PR build]

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants