Fix update-test-baselines scripts and SWA baseline fingerprint normalization for MTP#55027
Merged
Conversation
…ization for MTP
- Enable MTP runner in global.json (required on .NET 10+ SDK)
- Enable UseMicrosoftTestingPlatformRunner for MSTest.Sdk projects in test/Directory.Build.props
- Update update-test-baselines.ps1 and .sh:
- Filter: AspNetCore=BaselineTest -> TestCategory=BaselineTest (xUnit trait -> MSTest category)
- Logger: -l "console;verbosity=normal" -> -v normal (VSTest logger breaks MTP filter)
- Env var: -e -> --environment (MTP-compatible flag)
- Fix StaticWebAssetsBaselineFactory to normalize fingerprinted source map routes
by adding SourceMapFileRegex for {name}.{fingerprint}.map(.gz|.br)? patterns
- Update 24 baseline JSON files to replace hardcoded fingerprints in Route fields
with __fingerprint__ placeholder (blazor.server.js / blazor.web.js .map routes)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Evangelink
reviewed
Jun 26, 2026
- Use --project <TestProject> flag instead of positional directory arg in both scripts and SKILL.md - Remove UseMicrosoftTestingPlatformRunner=true from Directory.Build.props; it's xUnit syntax and is not needed when using MSTest.Sdk Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Microsoft.NET.Sdk.Razor.Tests has no BaselineTest tests, causing exit code 8 (zero tests ran). Also sync .sh with .ps1 by including Microsoft.NET.Sdk.StaticWebAssets.Tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Evangelink
reviewed
Jun 26, 2026
Evangelink
approved these changes
Jun 30, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes baseline regeneration and static web asset (SWA) baseline stability after the xUnit → MSTest / Microsoft.Testing.Platform (MTP) migration by updating the baseline update scripts, enabling the MTP runner via global.json, and normalizing previously hardcoded source-map fingerprints in SWA baseline manifests.
Changes:
- Update
update-test-baselinesscripts to use MTP-compatible flags (--project,-v normal,--environment, and--filter "TestCategory=BaselineTest"). - Add source-map fingerprint normalization to
StaticWebAssetsBaselineFactoryand update affected SWA baseline JSON files to use__fingerprint__. - Enable the MTP runner via
global.jsonand update baseline regeneration instructions.
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssetsBaselines/Rebuild_RegeneratesJsonManifestAndCopiesItToOutputFolder.Build.staticwebassets.json | Replace hardcoded .map(.gz) fingerprint routes with __fingerprint__ placeholders. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssetsBaselines/Rebuild_RegeneratesJsonManifestAndCopiesItToOutputFolder_Rebuild.Build.staticwebassets.json | Replace hardcoded .map(.gz) fingerprint routes with __fingerprint__ placeholders. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssetsBaselines/Publish_PublishSingleFile_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json | Normalize fingerprinted source-map routes (.map, .map.gz, .map.br) to __fingerprint__. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssetsBaselines/Publish_PublishSingleFile_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json | Normalize fingerprinted source-map routes (.map, .map.gz) to __fingerprint__. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssetsBaselines/Publish_PublishesJsModuleBundleBundleToTheRightLocation.Publish.staticwebassets.json | Normalize fingerprinted source-map routes (.map, .map.gz, .map.br) to __fingerprint__. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssetsBaselines/Publish_NoBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json | Normalize fingerprinted source-map routes (.map, .map.gz, .map.br) to __fingerprint__. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssetsBaselines/Publish_NoBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json | Normalize fingerprinted source-map routes (.map, .map.gz) to __fingerprint__. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssetsBaselines/Publish_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json | Normalize fingerprinted source-map routes (.map, .map.gz, .map.br) to __fingerprint__. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssetsBaselines/Publish_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json | Normalize fingerprinted source-map routes (.map, .map.gz) to __fingerprint__. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssetsBaselines/Publish_CreatesEndpointsForAssets.Publish.staticwebassets.json | Normalize fingerprinted source-map routes (.map, .map.gz, .map.br) to __fingerprint__. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssetsBaselines/Publish_CreatesEndpointsForAssets_BuildAndPublish_Assets.Publish.staticwebassets.json | Normalize fingerprinted source-map routes (.map, .map.gz, .map.br) to __fingerprint__. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssetsBaselines/Clean_RemovesManifestFrom_BuildAndIntermediateOutput.Build.staticwebassets.json | Normalize fingerprinted source-map routes (.map, .map.gz) to __fingerprint__. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssetsBaselines/Build_UpdatesManifest_WhenFilesChange.Build.staticwebassets.json | Normalize fingerprinted source-map routes (.map, .map.gz) to __fingerprint__. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssetsBaselines/Build_UpdatesManifest_WhenFilesChange_Updated.Build.staticwebassets.json | Normalize fingerprinted source-map routes (.map, .map.gz) to __fingerprint__. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssetsBaselines/Build_GeneratesJsonManifestAndCopiesItToOutputFolder.Build.staticwebassets.json | Normalize fingerprinted source-map routes (.map, .map.gz) to __fingerprint__. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssetsBaselines/Build_FingerprintsContent_WhenEnabled.Build.staticwebassets.json | Normalize fingerprinted source-map routes (.map, .map.gz) to __fingerprint__. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssetsBaselines/Build_DoesNotUpdateManifest_WhenHasNotChanged.Build.staticwebassets.json | Normalize fingerprinted source-map routes (.map, .map.gz) to __fingerprint__. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssetsBaselines/Build_DoesNotFailToCompress_TwoAssetsWith_TheSameContent.Build.staticwebassets.json | Normalize fingerprinted source-map routes (.map, .map.gz) to __fingerprint__. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssetsBaselines/Build_DiscoversJsModulesBasedOnPatterns.Build.staticwebassets.json | Normalize fingerprinted source-map routes (.map, .map.gz) to __fingerprint__. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssetsBaselines/Build_DeployOnBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Publish.staticwebassets.json | Normalize fingerprinted source-map routes (.map, .map.gz, .map.br) to __fingerprint__. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssetsBaselines/Build_DeployOnBuild_GeneratesPublishJsonManifestAndCopiesPublishAssets.Build.staticwebassets.json | Normalize fingerprinted source-map routes (.map, .map.gz) to __fingerprint__. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssetsBaselines/Build_DefaultDocumentAndSpaFallback_CreatesAdditionalEndpoints.Build.staticwebassets.json | Normalize fingerprinted source-map routes (.map, .map.gz) to __fingerprint__. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssetsBaselines/Build_CreatesEndpointsForAssets.Build.staticwebassets.json | Normalize fingerprinted source-map routes (.map, .map.gz) to __fingerprint__. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssetsBaselines/Build_Can_DisableAssetCaching.Build.staticwebassets.json | Normalize fingerprinted source-map routes (.map, .map.gz) to __fingerprint__. |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssetsBaselineFactory.cs | Add a regex rule to normalize fingerprinted source-map filenames (`*.{fingerprint}.map(.gz |
| test/Microsoft.NET.Sdk.StaticWebAssets.Tests/StaticWebAssetsBaselineComparer.cs | Update baseline regeneration instructions to build in Release. |
| src/RazorSdk/update-test-baselines.sh | Update script to use MTP-compatible dotnet test flags and MSTest category filtering. |
| src/RazorSdk/update-test-baselines.ps1 | Update script to use MTP-compatible dotnet test flags and MSTest category filtering. |
| global.json | Enable the MTP test runner via "test": { "runner": "Microsoft.Testing.Platform" }. |
| .claude/skills/swa-baseline-regeneration/SKILL.md | Update documented baseline regeneration commands to match new runner/flags. |
lewing
approved these changes
Jun 30, 2026
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.
Summary
Fixes two related issues after the xUnit → MSTest/MTP migration.
1. Fix
update-test-baselinesscriptsThe scripts used xUnit/VSTest-era conventions that no longer work with MTP:
--filter AspNetCore=BaselineTest--filter "TestCategory=BaselineTest"[TestCategory]-l "console;verbosity=normal"-v normal-e KEY=VALUE--environment KEY=VALUEAlso enables MTP runner: adds
"test": { "runner": "Microsoft.Testing.Platform" }toglobal.jsonandUseMicrosoftTestingPlatformRunner=truefor MSTest.Sdk projects intest/Directory.Build.props(MTP package v2.3+ refuses VSTest on .NET 10+ SDK).2. Fix hardcoded fingerprints in SWA baselines
Commit bcdeca9 introduced hardcoded fingerprints (e.g.
blazor.web.js.gon0ccxxql.map.gz) in 24 baseline JSONRoutefields.StaticWebAssetsBaselineFactoryhad no pattern for.{fingerprint}.map(.gz|.br)?source map files, so they were never normalized.Fix: Added
SourceMapFileRegextoWellKnownFileNamePatternsAndReplacementsand updated all 24 affected baseline files to use the__fingerprint__placeholder.3. Update baseline regeneration instructions
Updated
StaticWebAssetsBaselineComparer.csand theswa-baseline-regenerationskill to reflect the new script invocation (-v normal,--environment,"TestCategory=BaselineTest") and to specify-c Releasewhen building the repo before regenerating baselines.