Skip to content

[release/10.0.1xx] [devops] Fix a few issues with pwsh tests and test result parsing.#24572

Merged
rolfbjarne merged 2 commits intorelease/10.0.1xxfrom
dev/rolf/backport-pr-24516-release/10.0.1xx-2026-01-28
Jan 28, 2026
Merged

[release/10.0.1xx] [devops] Fix a few issues with pwsh tests and test result parsing.#24572
rolfbjarne merged 2 commits intorelease/10.0.1xxfrom
dev/rolf/backport-pr-24516-release/10.0.1xx-2026-01-28

Conversation

@rolfbjarne
Copy link
Member

  • Fix an issue parsing test results, causing errors like:

    Failed to compute test summaries: Method invocation failed because [System.Char] does not contain a method named 'Contains'.

  • Fix tests related to checking if a commit is the last in a PR.

Backport of #24516.

* Fix an issue parsing test results, causing errors like:

    Failed to compute test summaries: Method invocation failed because [System.Char] does not contain a method named 'Contains'.

* Fix tests related to checking if a commit is the last in a PR.
Copy link
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

This PR refines Azure DevOps test summary parsing and exposes a simple helper for checking whether the current commit is the latest in a PR, adding and updating tests to validate these behaviors.

Changes:

  • Fix ParallelTestsResults.WriteComment to correctly parse existing <summary>/<details>/## Failed tests blocks, avoid the [System.Char] .Contains error by forcing Get-Content to produce an array, and prevent duplicating or truncating Markdown sections.
  • Extend and adjust TestResults.Tests.ps1 to cover scenarios with multiple failing test suites, richer macOS failure summaries, and ensure aggregate counts and rendered Markdown match the new parsing behavior.
  • Add a Get-IsCurrentCommitLatestInPR function in GitHub.psm1, export it from the module, and update GitHub.Tests.ps1 to assert correct behavior in PR and non‑PR contexts via this new API.

Reviewed changes

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

File Description
tools/devops/automation/scripts/TestResults.psm1 Improves test summary Markdown parsing in ParallelTestsResults.WriteComment, handling existing <details>/<summary> blocks and fixing the .Contains on char issue by treating file contents as a string array.
tools/devops/automation/scripts/TestResults.Tests.ps1 Updates and adds test fixtures and expectations to validate new summary parsing behavior and scenarios with additional failing macOS tests.
tools/devops/automation/scripts/GitHub.psm1 Introduces and exports Get-IsCurrentCommitLatestInPR, a small wrapper around GitHubComments.IsCurrentCommitLatestInPR for easier use in scripts.
tools/devops/automation/scripts/GitHub.Tests.ps1 Refactors existing tests to use Get-IsCurrentCommitLatestInPR and verifies correct results when the current commit matches/does not match the PR head and when no PR context exists.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #d891650] Build passed (Build packages) ✅

Pipeline on Agent
Hash: d891650115175cd9175c7d5447c72583f0a00747 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

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

Pipeline on Agent
Hash: d891650115175cd9175c7d5447c72583f0a00747 [PR build]

@rolfbjarne rolfbjarne enabled auto-merge (squash) January 28, 2026 09:11
@vs-mobiletools-engineering-service2
Copy link
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: d891650115175cd9175c7d5447c72583f0a00747 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #d891650] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: d891650115175cd9175c7d5447c72583f0a00747 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #d891650] Tests on macOS X64 - Mac Sonoma (14) passed 💻

All tests on macOS X64 - Mac Sonoma (14) passed.

Pipeline on Agent
Hash: d891650115175cd9175c7d5447c72583f0a00747 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #d891650] Tests on macOS M1 - Mac Monterey (12) passed 💻

All tests on macOS M1 - Mac Monterey (12) passed.

Pipeline on Agent
Hash: d891650115175cd9175c7d5447c72583f0a00747 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #d891650] Tests on macOS M1 - Mac Ventura (13) passed 💻

All tests on macOS M1 - Mac Ventura (13) passed.

Pipeline on Agent
Hash: d891650115175cd9175c7d5447c72583f0a00747 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #d891650] Tests on macOS arm64 - Mac Sequoia (15) passed 💻

All tests on macOS arm64 - Mac Sequoia (15) passed.

Pipeline on Agent
Hash: d891650115175cd9175c7d5447c72583f0a00747 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #d891650] Tests on macOS arm64 - Mac Tahoe (26) passed 💻

All tests on macOS arm64 - Mac Tahoe (26) passed.

Pipeline on Agent
Hash: d891650115175cd9175c7d5447c72583f0a00747 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🚀 [CI Build #d891650] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 117 tests passed 🎉

Tests counts

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 9 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 11 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 9 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 9 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ msbuild: All 2 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

Pipeline on Agent
Hash: d891650115175cd9175c7d5447c72583f0a00747 [PR build]

@rolfbjarne rolfbjarne merged commit 446b331 into release/10.0.1xx Jan 28, 2026
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants