Repository navigation
feat(sdk): add the HotTesting Uno feature - #26720
Draft
iurycarlos wants to merge 5 commits into
Draft
iurycarlos wants to merge 5 commits into
iurycarlos wants to merge 5 commits into
Conversation
- 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]>
Contributor
Author
|
Still in draft as we need the nuget package number to be replaced here. |
Contributor
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
Contributor
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-26720/docs/index.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.HotTestingfromUnoFeaturesinstead of a hand-addedPackageReference:HotTestingfeature. In builds whereOptimizeisn'ttrue(Debug), the Uno.Sdk referencesUno.HotTestingwithPrivateAssets="all", the same as the other development-time packages.HotTestingTestsFolder, which defaults toTests. It's left out of Release builds, the same wayHotDesignPreviewsFolderis, so a Release build neither compiles nor ships the tests.Uno.HotTestinghas its own version line (0.1.0-dev.*), so it gets its ownhottestinggroup inpackages.json, with aUnoHotTestingVersionoverride wired likeUnoHotDesignVersion.UnoDisableHotTestingalready turned offUno.HotTesting.Reactive. It now also turns offUno.HotTesting, and leaves the tests folder out of every build, so an app with tests still builds.Reviewer's guide
src/Uno.Sdk/targets/Uno.Implicit.Packages.ProjectSystem.targets(the reference),Uno.Common.targetsandUno.DefaultItems.targets(the folder, next toHotDesignPreviewsFolder).UnoHotDesignVersion.docs(sdk): …).UnoDisableHotTesting: tests always depend on MSTest. Without that, turning the switch on made every build fail with CS0246 onTestClass(thefix(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 aTests/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 publishedUno.WinUI 7.1.0-dev.585) and built a blankdotnet new unoappdesktop app withHotTestingand aTests/SampleTests.csusing[TestClass]andTestContext:Uno.HotTesting.dllandMSTest.TestFramework.Extensions.dllin the output, test compiled into the app.Uno.HotTesting, no MSTest in the restore graph or the output, no test type in the app.UnoDisableHotTesting=truefix(sdk)commit.HotTestingTestsFolder=AppTestsNot built: WebAssembly, Android, iOS and WinAppSDK heads. The package targets
net10.0.Before a stable release
0.1.0-dev.182, is a prerelease, like the existingUnoMauiandUnoRetargetpins. A stable Uno.Sdk shouldn't ship it:Uno.HotTestingneeds a stable release first.0.1.0-dev.182still depends onMSTest.TestAdapter, so Debug apps that turn the feature on also get Microsoft.Testing.Platform and its telemetry. unoplatform/uno.hottesting#113 narrows that toMSTest.TestFramework. The pin gets bumped once a build with it is published.PR Checklist ✅
Screenshots Compare Test Runresults.UnoDisableHotTestingkeeps its effect on MVUX🤖 Generated with Claude Code