Skip to content

chore(deps): bump MSTest.TestFramework to 4.3.3 and Uno.UI.RuntimeTests.Engine to 2.0.0-dev.89 - #1649

Merged
rajamatt merged 6 commits into
mainfrom
dev/mara/canary-mstest4
Sep 28, 2026
Merged

rajamatt merged 6 commits into
mainfrom
dev/mara/canary-mstest4

Conversation

@rajamatt

@rajamatt rajamatt commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

GitHub Issue (If applicable): #

PR Type

  • Build or CI related changes

What is the current behavior?

The toolkit canary (build #235212) bumps Uno.UI.RuntimeTests.Engine from 2.0.0-dev.79 to 2.0.0-dev.89. That version requires MSTest.TestFramework >= 4.3.3, and our central pin is 2.1.2. As a result, all 8 sample jobs and the Hot-Reload job fail restore:

error NU1605: Warning As Error: Detected package downgrade: MSTest.TestFramework from 4.3.3 to 2.1.2.
  Uno.Toolkit.RuntimeTests -> Uno.UI.RuntimeTests.Engine 2.0.0-dev.89 -> MSTest.TestFramework (>= 4.3.3)
  Uno.Toolkit.RuntimeTests -> MSTest.TestFramework (>= 2.1.2)

main hits the same failure as soon as it takes Engine dev.89.

What is the new behavior?

  • MSTest.TestFramework 2.1.2 → 4.3.3, and Uno.UI.RuntimeTests.Engine dev.79 → dev.89, together.
  • MSTest 4 pulls in MSTest.Analyzers, which caused 408 errors under TreatWarningsAsErrors:
    • Test classes made public: MSTEST0002/0003/0009 (392 of the errors). 33 test classes were internal, and MSTEST0003/0009 only flagged the public members of those classes, so nothing else needed fixing. They're now public like the other 22, with no suppression and no DiscoverInternals. The diff is one modifier per class declaration (34 files).
    • Fixed in code:
      • Assert.ThrowsException → Assert.ThrowsExactly, since v4 removed ThrowsException (TabBarTests).
      • Swapped expected/actual arguments (MSTEST0017) in AutoLayoutTest and DrawerFlyoutTests.
      • Removed the redundant DynamicDataSourceType.Method (MSTEST0052).
      • NavigationBarTests.MainCommand_In_Popup_Without_Page: its asserts were inside an async void Popup.Opened lambda (MSTEST0040), so they could never fail the test. The test now captures the result through a TaskCompletionSource (with a 2 s timeout, like ExtendedSplashScreenTests) and asserts in the test body.
      • ResponsiveExtensionsTests.ProvideValue_ZeroSize_NoSizeChange compared a Layout? to a string (CS0411 with v4's generic AreEqual<T>), which could never pass. It's hidden today because the class is [Ignore]d on Uno. It now asserts that the text and the resolved layout are unchanged.
  • MSTest's buildTransitive targets add global using Microsoft.VisualStudio.TestTools.UnitTesting to every consumer that has ImplicitUsings, which includes the sample apps. That made [Description] ambiguous with System.ComponentModel. A new samples/Directory.Build.targets removes that using with a static <Using Remove>, and chains to the root Directory.Build.targets. It has to be a .targets file because NuGet imports the package's Using after Directory.Build.props but before Directory.Build.targets. The sample code doesn't use MSTest.
  • AGENTS.md: a headless runtime-test run also needs UNO_RUNTIME_TESTS_OUTPUT_PATH. Without it, --runtime-tests= just opens the interactive runner, which sits idle. Recorded in specs/lessons.md.

PR Checklist

  • Tested code with current supported SDKs
  • Tested the changes where applicable (desktop Skia only, see below)
  • Runtime Tests and/or UI Tests for the changes have been added (for bug fixes / features) (if applicable). No new behavior; existing tests updated.
  • Contains NO breaking changes (test and sample projects only; no shipped package changes)
  • Associated with an issue (GitHub or internal)
  • Commits must be following the Conventional Commits specification.

Other information

Verified locally on Windows, net10.0-desktop, Material head:

  • dotnet build … -c Release: 0 errors. Its 100 warnings match main's count: existing nullability warnings in sample code, plus the AndroidX NU1608 restore warning. -c Debug: 0 errors.
  • Headless runtime tests (Release, the same way CI runs them: UNO_RUNTIME_TESTS_RUN_TESTS='{}' and UNO_RUNTIME_TESTS_OUTPUT_PATH, plus --runtime-tests=): 361 total, 361 passed, 0 failed, 11 skipped. main gives the same counts, so test discovery is unchanged. The touched tests that run on desktop all pass, including the reworked MainCommand_In_Popup_Without_Page (Back/Action).
  • Not run locally: hot-reload tests (Debug only), Android/iOS/WASM heads, and AttachedProperty_Inheritance (WinAppSDK only). CI covers those.

Related: #1648 (syncs canaries/dev with main to fix the separate NETSDK1147 failure in the Packages job).

🤖 Generated with Claude Code

…ts.Engine to 2.0.0-dev.89

- RuntimeTests.Engine 2.0.0-dev.89 requires MSTest.TestFramework >= 4.3.3; the 2.1.2 central pin fails restore with NU1605 in every sample head (canary build 235212)
- Suppress MSTEST0002/0003/0009 in Uno.Toolkit.RuntimeTests: the engine discovers internal test classes, which the MSTest analyzers do not know about (same as uno.csharpmarkup)
- Assert.ThrowsException -> Assert.ThrowsExactly (removed in MSTest 4)
- Fix analyzer findings: swapped expected/actual (MSTEST0017), redundant DynamicDataSourceType (MSTEST0052), and asserts in an async void Popup.Opened handler that could never fail the test (MSTEST0040)
- ProvideValue_ZeroSize_NoSizeChange compared a Layout? to a string (CS0411 under MSTest 4); assert the text and resolved layout are unchanged instead
- Remove MSTest's transitive global using from the sample apps, where it made [Description] ambiguous with System.ComponentModel

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rajamatt rajamatt self-assigned this Sep 23, 2026
@github-actions

Copy link
Copy Markdown

@rajamatt
rajamatt marked this pull request as ready for review September 23, 2026 17:26
@rajamatt
rajamatt enabled auto-merge (squash) September 23, 2026 18:04
@rajamatt
rajamatt disabled auto-merge September 23, 2026 20:44
@rajamatt
rajamatt marked this pull request as draft September 23, 2026 20:45
rajamatt and others added 3 commits September 25, 2026 10:02
…MSTest analyzers

- Add [assembly: DiscoverInternals] so MSTEST0002/0003/0009 accept the internal test classes the engine already discovers
- Drop the MSTEST0002/0003/0009 NoWarn from Uno.Toolkit.RuntimeTests.csproj

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Move the Using Remove for Microsoft.VisualStudio.TestTools.UnitTesting into samples/Directory.Build.targets, which NuGet's package targets are imported before
- Drop the custom target hooked to the SDK's GenerateGlobalUsings from samples/Directory.Build.props
- Chain the new file to the root Directory.Build.targets

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- AGENTS.md: headless runs need UNO_RUNTIME_TESTS_OUTPUT_PATH as well as --runtime-tests, or the app idles in the interactive runner
- specs/lessons.md: record the idle local run and how to confirm a run actually started

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown

- Make the 33 internal [TestClass] types public, matching the 22 that already are, so MSTEST0002/0003/0009 pass without an opt-out
- Remove [assembly: DiscoverInternals] so the analyzers keep flagging new internal test classes

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rajamatt
rajamatt requested a review from Xiaoy312 September 25, 2026 14:17
@rajamatt
rajamatt marked this pull request as ready for review September 25, 2026 14:17
@github-actions

Copy link
Copy Markdown

…iles

- Convert the 10 block-scoped test files this PR already edits, with Roslyn's IDE0161 fix; apart from the namespace line and braces, only indentation changes
- ItemsRepeaterExtensionTests.ISelectionInfo: SelectionData and SelectionSource were declared after the namespace block, in the global namespace; they now live in Uno.Toolkit.RuntimeTests.Tests (used only in that file)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rajamatt
rajamatt enabled auto-merge (squash) September 28, 2026 19:44
@github-actions

Copy link
Copy Markdown

@rajamatt
rajamatt merged commit 82aa554 into main Sep 28, 2026
23 checks passed
@rajamatt
rajamatt deleted the dev/mara/canary-mstest4 branch September 28, 2026 20:01
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.

2 participants