Repository navigation
fix(tests): Hot Reload runtime test correctness - #24125
Conversation
|
Claude finished @MartinZikmund's task in 5m 4s —— View job Review: fix(tests): Hot Reload runtime test correctness
Overall verdict: ship with minor fixesThe four changes are all correct and address real test defects with clear reasoning. The XAML content fix is verified against Two findings in 1 medium · 1 low · No findings in the other three files. Conventional Commits titles, no |
There was a problem hiding this comment.
Pull request overview
This PR fixes correctness gaps in the Hot Reload runtime test suite so failures are surfaced reliably (no vacuous “pass” when nothing ran), and assertions/edit operations match real page content and platform reporting behavior.
Changes:
- Fixes forwarded-filter handling so the outer workspace test is removed even when filters use fully qualified names, and fails if the HRApp returns no results.
- Updates RID→platform cross-checking to avoid asserting against an invalid “oracle” when the host doesn’t stamp a RID.
- Aligns resilience tests with actual XAML content and adds a guard to fail fast when a requested file edit would be a no-op (with safer undo behavior).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Uno.UI.RuntimeTests/Tests/HotReload/Given_HotReloadWorkspace.cs | Improves filter stripping and adds an explicit failure when the HRApp reports zero tests. |
| src/Uno.UI.RuntimeTests/Tests/HotReload/Given_ClientHotReloadProcessor.cs | Makes RID-based platform expectations explicit and avoids incorrect “skia” fallback when RID is unknown. |
| src/Uno.UI.RuntimeTests/Tests/HotReload/Frame/HRApp/Tests/HotReloadHelper.cs | Adds a preflight guard for no-op edits and adjusts revert logic to avoid undoing when no edit occurred. |
| src/Uno.UI.RuntimeTests/Tests/HotReload/Frame/HRApp/Tests/Given_HotReloadResilience.cs | Fixes test expectations to target real page content and element names. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24125/wasm-skia-net9/index.html |
|
The build 228604 found UI Test snapshots differences: Details
|
|
Claude finished @MartinZikmund's task in 5m 20s —— View job Review: fix(tests): Hot Reload runtime test correctness
Overall verdict: ship with minor fixesThe four correctness repairs are all sound. The XAML-content fix is verified against 2 findings in
No findings in |
|
The build 228645 found UI Test snapshots differences: Details
|
5048333 to
804ef5c
Compare
|
Claude finished @MartinZikmund's task in 1m 17s —— View job Review: fix(tests): Hot Reload runtime test correctness (sync)
Overall verdict: shipThis synchronize push is a single-line removal: the The removal is correct and safe because:
The old exclusion was over-broad — No findings. No inline comments to post. No issues from prior reviews remain open in this file — the two medium/low findings flagged by earlier review passes were in |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24125/wasm-skia-net9/index.html |
|
The build 228916 found UI Test snapshots differences: Details
|
The RID mapping fell through to "skia" for every unrecognised runtime identifier. The CoreCLR-on-Android host never sets RUNTIME_IDENTIFIER, so RuntimeInformation.RuntimeIdentifier reports "unknown", the test expected "skia" and the product correctly reported "android". It failed on 100% of android-skia-coreclr runs since 2026-07-21 — deterministic, not flaky. Map only recognised RID families and treat anything else as "no independent oracle available", still asserting that a platform was reported. The desktop family is now matched explicitly (win/linux/osx/freebsd) instead of by fallthrough, so a genuinely unexpected RID can no longer be silently accepted as desktop. This also drops the [PlatformCondition(Exclude, SkiaAndroid)] workaround, which was over-broad: SkiaAndroid covers both the Mono head, where the test passes, and the CoreCLR head, so the exclusion was removing working coverage. Runtime-validated on Skia Desktop Win32 (RID win-x64), which now exercises the new explicit desktop branch: passes. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01Tj7eBARpKztfeLfaLTWde7
804ef5c to
3e17929
Compare
|
Claude finished @MartinZikmund's task in 1m 1s —— View job Review: fix(tests): Hot Reload runtime test correctness (sync)
Overall verdict: shipThis synchronize push is a single-line removal: The removal is correct and safe for both Skia-Android variants:
No findings. No issues from prior reviews remain open in this file — the medium/low findings flagged by earlier review passes were in |
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24125/wasm-skia-net9/index.html |
|
The build 229241 found UI Test snapshots differences: Details
|
|
Tick the box to add this pull request to the merge queue (same as
|
GitHub Issue: closes #24124
PR Type:
🏗️ Build or CI related changes
What changed? 🚀
Four Hot Reload runtime-test defects, one commit each. Split out of #24112 so the Hot Reload work can be reviewed on its own; #24112 keeps the macOS native-handle crash and the default test-body timeout.
test(hotreload): only cross-check the platform when a RID was stampedThe RID mapping fell through to
"skia"for any unrecognised runtime identifier. The CoreCLR-on-Android host never setsRUNTIME_IDENTIFIER, so the test expectedskiawhile the product correctly reportedandroid— failing 100% ofandroid-skia-coreclrruns since 2026-07-21. Only recognised RID families are mapped now; anything else means no independent oracle is available, and the desktop family is matched explicitly instead of by fallthrough. This also drops the[PlatformCondition(Exclude, SkiaAndroid)]workaround, which was over-broad —SkiaAndroidcovers the Mono head too, where the test passes.test(hotreload): stop the workspace scenario passing without runningOn a CI retry the filter is rebuilt from the published failed-tests list, which carries fully qualified names, but the outer test stripped itself by comparing bare identifiers only.
…Given_HotReloadWorkspace.When_HotReloadScenariowas therefore forwarded to an HRApp that has no such test: it ran nothing, returned an empty result set, and the outer test reported success because there were no failures to collect. Now matches the fully qualified forms and fails explicitly when the HRApp returns no results, mirroring thefail-emptyguard the CI scripts already apply to the outer run.test(hotreload): assert on page content that existsGiven_HotReloadResiliencedroveHR_Frame_Pages_Page1by replacing"Hello"and then asserted on a TextBlock namedtb1. The page contains neither — its TextBlocks areFirstPageTextBlock(Text="First page") and a{Binding TitleText}one, andgrep -rn "tb1"over the HotReload tree returns only the two lines of the assertion itself. The edit matched nothing and the assert then failed on an element that was never there.This is the failure behind the red Tests - Desktop Skia Windows stage. Build 228363, test run 3886445:
Both tests now target the TextBlock the page actually declares.
test(hotreload): fail fast when a file edit matches nothingThe replacement is performed server-side, so a search string matching nothing is a silent no-op: no file change, no reload, and a test that asserts against content it never updated. That is how the stale
"Hello"/tb1expectations survived for four months.HotReloadHelpernow verifies the text is present before asking the server to replace it, naming the file and the caller when it is not. The check is skipped when the source is not readable from the test process, so the server stays the authority rather than a new failure mode appearing.The
*AndReverthelpers also undo only when an edit actually happened — reverting a file that was never modified trips the same guard from afinallyblock, which would replace the original failure with a confusing one.Validation
win-x64), exercising the new explicit desktop branch: passes.HR_Frame_Pages_Page1.xamldeclares exactly one"First page"andx:Name="FirstPageTextBlock"; notb1, no"Hello".Uno.UI.RuntimeTests.Skia.csprojbuilds clean on net10.0 — 0 errors, 0 warnings. The end-to-end hot-reload path needs a DevServer plus the HRApp child process, so the Tests - Desktop Skia Windows leg on this PR is the real validation.tb1failure. That is correct behaviour, not a regression.PR Checklist ✅
Screenshots Compare Test Runresults.