Enable and fix WASM tests#52960
Conversation
2b03ecb to
5f99f1b
Compare
| { | ||
| stream = File.Open(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete); | ||
| } | ||
| catch (FileNotFoundException) |
There was a problem hiding this comment.
Need to follow up on why the manifest is sometimes not be produced by the build... #52994
dc55cf4 to
250e130
Compare
4c3ebfd to
9e2a62f
Compare
|
@maraf ptal |
There was a problem hiding this comment.
Pull request overview
This PR fixes WASM hot reload test failures by correcting the asset layout for Microsoft.DotNet.HotReload.WebAssembly.Browser. The tests were failing because the hot reload agent DLL and JavaScript module were not being copied to the correct directory structure in the SDK package. The fix centralizes target framework versioning and updates the ProjectReference configuration to properly include the hot reload agent outputs.
Changes:
- Fixed WASM hot reload asset paths (removed incorrect
wwwroot\prefix from package layout) - Introduced centralized target framework version management via
TargetFrameworks.props - Re-enabled previously skipped WASM hot reload tests across Windows and non-Windows platforms
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/WasmSdk/Sdk/TargetFrameworks.props |
New file defining centralized WASM agent target framework version (net10.0) |
src/WasmSdk/Tasks/Microsoft.NET.Sdk.WebAssembly.Tasks.csproj |
Updated ProjectReference to use OutputItemType/PackagePath/Targets for proper asset inclusion; removed manual AdditionalContent include; added TargetFrameworks.props import; updated CopyAdditionalFilesToLayout condition |
src/WasmSdk/Sdk/Sdk.targets |
Fixed source path for hot reload JS module (removed wwwroot\ prefix); uses WasmAgentTargetFrameworkV10 property; imports TargetFrameworks.props |
src/BuiltInTools/HotReloadAgent.WebAssembly.Browser/Microsoft.DotNet.HotReload.WebAssembly.Browser.csproj |
Uses centralized WasmAgentTargetFrameworkV10 property instead of hardcoded net10.0 |
test/dotnet-watch.Tests/HotReload/ApplyDeltaTests.cs |
Removed Windows-only restrictions and Skip attributes from WASM tests; added identifier parameter for test isolation; updated test assertions; fixed typo ("it's" → "its"); updated issue reference from #49928 to #53058 |
test/dotnet-watch.Tests/Browser/BrowserTests.cs |
Removed Windows-only restriction from BrowserDiagnostics test |
src/BuiltInTools/Watch/Build/EvaluationResult.cs |
Fixed file extension comparison to use case-appropriate string comparison |
src/BuiltInTools/HotReloadClient/Web/StaticWebAssetsManifest.cs |
Added explicit FileNotFoundException handling to avoid error logging for expected missing files |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/ba-g Linux machine is crashing with no logs. |
Fixes Microsoft.DotNet.HotReload.WebAssembly.Browser asset layout. The test were failing to build WASM projects because
Microsoft.DotNet.HotReload.WebAssembly.Browser.lib.module.jsandMicrosoft.DotNet.HotReload.WebAssembly.Browser.dllwere not copied to the right directories.Reenables WASM Hot Reload tests in dotnet-watch test suite.