Skip to content

fix(sdk): Skip UNOB0029 for Testing Platform test projects - #26249

Merged
MartinZikmund merged 1 commit into
masterfrom
dev/mazi/unob0029-mstest-sdk
Nov 10, 2026
Merged

MartinZikmund merged 1 commit into
masterfrom
dev/mazi/unob0029-mstest-sdk

Conversation

@MartinZikmund

Copy link
Copy Markdown
Member

GitHub Issue: n/a (no existing issue)

PR Type:

🐞 Bugfix

What changed? 🚀

dotnet test on a <Project Sdk="MSTest.Sdk"> project (Microsoft.Testing.Platform) that references an Uno project fails with UNOB0029. The check skips test projects through IsTestProject, but MSTest.Sdk and xUnit v3 don't set it. They only get IsTestingPlatformApplication=true, and they are Exe, so they were treated as application heads. Apps had to add UnoDisableUNOB0029Validation to their test projects.

ValidateUnoSdkUsage now also skips when IsTestingPlatformApplication is true. The comment claimed all of these runners set IsTestProject; it now says which property covers which runner, and the docs line is adjusted to match.

Verified with a stand-in project that imports the real ValidateUnoSdkUsage target (extracted verbatim from uno.winui.common.targets, since the full file pulls in source generator imports). Ran dotnet msbuild -t:ValidateUnoSdkUsage against master's file and the patched one:

Project Master Patched
MSTest.Sdk 4.5.2 on MTP UNOB0029 passes
xUnit v3 (xunit.v3 package) UNOB0029 passes
TUnit passes (sets IsTestProject) passes
Microsoft.NET.Test.Sdk passes passes
Plain Microsoft.NET.Sdk Exe, no test packages UNOB0029 UNOB0029 (still rejected)
Plain Exe + UnoDisableUNOB0029Validation=true passes passes

No test added: the earlier change to this check (83ed8ea) had none, and the repo has no harness for build validations in build/nuget.

PR Checklist ✅

🤖 Generated with Claude Code

https://claude.ai/code/session_01TXMNu1grTmfuTQEg1iNSrT

MSTest.Sdk and xUnit v3 test projects run on Microsoft.Testing.Platform and
are Exe, but only set IsTestingPlatformApplication, not IsTestProject. A test
project referencing an Uno project failed with UNOB0029. Skip the check when
IsTestingPlatformApplication is true, and correct the comment on which
runner sets which property.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TXMNu1grTmfuTQEg1iNSrT
Copilot AI balanced review requested due to automatic review settings November 9, 2026 09:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 10s —— View job


Review of #26249

Verdict: ship. No inline findings.

  • The change is minimal and correct. The new '$(IsTestingPlatformApplication)'!='true' clause sits in a target Condition, which is evaluated when the target runs. So it doesn't matter whether the Microsoft.Testing.Platform props or targets set the property before or after this file is imported.
  • The updated comment and the docs line match the new behavior.
  • Issues by severity: 0 blocking, 0 major, 0 minor.

Two cross-cutting notes, neither blocking:

  • Looser check: any Exe that sets IsTestingPlatformApplication=true now bypasses UNOB0029. That is the intent here, since these are test hosts. The UnoDisableUNOB0029Validation escape hatch is unchanged.
  • No automated test: the PR description explains this and shows the manual matrix, which I find reasonable. I did not rebuild or re-run that matrix myself. This review is by inspection of the diff only.

The commit and PR title follow Conventional Commits.

@github-actions github-actions Bot added area/build Categorizes an issue or PR as relevant to build infrastructure kind/documentation labels Nov 9, 2026
@unodevops

Copy link
Copy Markdown
Contributor

@MartinZikmund
MartinZikmund merged commit 92d96ed into master Nov 10, 2026
56 of 58 checks passed
@MartinZikmund
MartinZikmund deleted the dev/mazi/unob0029-mstest-sdk branch November 10, 2026 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Categorizes an issue or PR as relevant to build infrastructure kind/documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants