Skip to content

feat(sdk): add the HotTesting Uno feature - #26720

Draft
iurycarlos wants to merge 5 commits into
masterfrom
dev/ics/hottesting-sdk-feature
Draft

iurycarlos wants to merge 5 commits into
masterfrom
dev/ics/hottesting-sdk-feature

Conversation

@iurycarlos

Copy link
Copy Markdown
Contributor

GitHub Issue: closes #26719

Part of unoplatform/uno.hottesting#111 — Uno template apps should get Hot Testing through a HotTesting SDK feature

PR Type:

✨ Feature

What changed? 🚀

Apps can now get Uno.HotTesting from UnoFeatures instead of a hand-added PackageReference:

  • HotTesting feature. In builds where Optimize isn't true (Debug), the Uno.Sdk references Uno.HotTesting with PrivateAssets="all", the same as the other development-time packages.
  • Tests folder. The app's tests live in HotTestingTestsFolder, which defaults to Tests. It's left out of Release builds, the same way HotDesignPreviewsFolder is, so a Release build neither compiles nor ships the tests.
  • Version. Uno.HotTesting has its own version line (0.1.0-dev.*), so it gets its own hottesting group in packages.json, with a UnoHotTestingVersion override wired like UnoHotDesignVersion.
  • Off switch. UnoDisableHotTesting already turned off Uno.HotTesting.Reactive. It now also turns off Uno.HotTesting, and leaves the tests folder out of every build, so an app with tests still builds.

Reviewer's guide

  • Start here: src/Uno.Sdk/targets/Uno.Implicit.Packages.ProjectSystem.targets (the reference), Uno.Common.targets and Uno.DefaultItems.targets (the folder, next to HotDesignPreviewsFolder).
  • Mechanical: the first commit, the new group and its override. It touches the same six places as UnoHotDesignVersion.
  • Docs-only commits: the last two (docs(sdk): …).
  • Why the tests folder is also excluded with UnoDisableHotTesting: tests always depend on MSTest. Without that, turning the switch on made every build fail with CS0246 on TestClass (the fix(sdk) commit).

How it was checked

There's no automated test: SDK features are covered by build/test-scripts/run-netcore-mobile-template-tests.ps1, whose jobs are currently disabled until the 7.0 dependents ship. A row there would also need a template project with a Tests/ folder, which every other row builds without the feature.

I packed this branch as Uno.Sdk.Private 7.1.0-dev.585 (Core resolves to the published Uno.WinUI 7.1.0-dev.585) and built a blank dotnet new unoapp desktop app with HotTesting and a Tests/SampleTests.cs using [TestClass] and TestContext:

Build Result
Debug Builds. Uno.HotTesting.dll and MSTest.TestFramework.Extensions.dll in the output, test compiled into the app.
Release Builds. No Uno.HotTesting, no MSTest in the restore graph or the output, no test type in the app.
Debug / Release + UnoDisableHotTesting=true Both build, without the package and without the test. Failed before the fix(sdk) commit.
Release + HotTestingTestsFolder=AppTests Builds; that folder is left out.

Not built: WebAssembly, Android, iOS and WinAppSDK heads. The package targets net10.0.

Before a stable release

  • The pin, 0.1.0-dev.182, is a prerelease, like the existing UnoMaui and UnoRetarget pins. A stable Uno.Sdk shouldn't ship it: Uno.HotTesting needs a stable release first.
  • 0.1.0-dev.182 still depends on MSTest.TestAdapter, so Debug apps that turn the feature on also get Microsoft.Testing.Platform and its telemetry. unoplatform/uno.hottesting#113 narrows that to MSTest.TestFramework. The pin gets bumped once a build with it is published.

PR Checklist ✅

  • 🧪 Added Runtime tests, UI tests, or a manual test sample: manual check above; template-test jobs are disabled
  • 📚 Docs have been added/updated
  • 🖼️ Validated PR Screenshots Compare Test Run results.
  • ❗ Contains NO breaking changes: the feature is opt-in; UnoDisableHotTesting keeps its effect on MVUX
  • 👀 Reviewed 2 other open pull requests

🤖 Generated with Claude Code

iurycarlos and others added 5 commits November 25, 2026 13:29
- Uno.HotTesting has its own version line (0.1.0-dev.*), so it gets its
  own group instead of following the Extensions group.
- UnoHotTestingVersion overrides it, wired like UnoHotDesignVersion.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- HotTesting references Uno.HotTesting in non-optimized builds, with
  PrivateAssets="all", like the other development-time packages.
- HotTestingTestsFolder (Tests by default) holds the app's tests and is
  excluded from optimized builds, like HotDesignPreviewsFolder, so a
  Release build neither compiles nor ships them.
- UnoDisableHotTesting now turns off both Uno.HotTesting and
  Uno.HotTesting.Reactive.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- UnoDisableHotTesting removed the package but also stopped defining
  HotTestingTestsFolder, so an app with tests failed to compile them
  (CS0246 on TestClass) in Debug and Release.
- The folder is now defined whenever HotTesting is listed, and excluded
  when Optimize is true or UnoDisableHotTesting is set.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Add HotTesting to the UnoFeatures table and UnoHotTestingVersion to
  the version overrides.
- Add a "Hot Testing in non-optimized builds" section: the Tests folder,
  HotTestingTestsFolder, and what UnoDisableHotTesting turns off.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- An existing Tests folder is left out of Release once the feature is on.
- Explicit Compile includes are not excluded.
- Libraries with tests need the feature in the app too.
- UnoDisableHotTesting leaves the folder out of every build.
- What a test outside the folder looks like in a Release build.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@iurycarlos iurycarlos self-assigned this Nov 25, 2026
@github-actions github-actions Bot added kind/documentation area/sdk Categorizes an issue or PR as relevant to the Uno.Sdk labels Nov 25, 2026
@iurycarlos

Copy link
Copy Markdown
Contributor Author

Still in draft as we need the nuget package number to be replaced here.

@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

@unodevops

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/sdk Categorizes an issue or PR as relevant to the Uno.Sdk kind/documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Apps can't get Hot Testing from UnoFeatures, only from a manual PackageReference

2 participants