Skip to content

Modernize XamlCompiler tests, Part II (test fixes only) - #11837

Open
Evelyn Wu (evelynwu-msft) wants to merge 23 commits into
user/evelynwu/xamlcompiler-product-fixesfrom
user/evelynwu/xamlcompiler-test-modernization
Open

Evelyn Wu (evelynwu-msft) wants to merge 23 commits into
user/evelynwu/xamlcompiler-product-fixesfrom
user/evelynwu/xamlcompiler-test-modernization

Conversation

@evelynwu-msft

Copy link
Copy Markdown
Member

Fixes

Fixes #11835

PR Type

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

Description

Current Behavior

The XamlCompiler test tree still contains unsupported UWP, Visual Basic, C++/CX, back-compat, and dirs-based assets. Its projects use inconsistent build models and output paths, several regression scenarios cannot build against the local compiler, and codegen comparison coverage is incomplete.

The test and product projects also share solution/build plumbing, lack complete ARM64EC support, and use a single set of generated-code masters for both checked and free builds.

New Behavior

This PR:

  • Removes unsupported legacy test assets and ports required native coverage to C++/WinRT.
  • Modernizes the regression projects for the WinUI 3 desktop build model.
  • Adds managed projections and metadata repair for C#/WinRT test components.
  • Runs regression projects against the compiler built from this enlistment.
  • Separates product and test solutions and supports standalone x86, x64, ARM64, and ARM64EC builds.
  • Restores and optimizes the XamlCompiler unit-test payload.
  • Shares one mapping between generated output, master refresh, and DiffCodegen tests.
  • Re-enables all 28 DiffCodegen tests and adds separate chk and fre masters.
  • Hardens incremental-codegen coverage and makes master regeneration atomic.

The large file count is primarily legacy asset removal and generated-master migration. The commits keep generated baseline updates separate from test and infrastructure changes where practical.

Customer Impact

There is no user-facing or API change. This improves coverage and reliability for XamlCompiler changes by validating the supported WinUI 3 project models, architectures, and checked/free compiler outputs. Restoring XamlCompiler's test coverage allows future bug fixes to be made more quickly and confidently.

Regression Potential

The risk is limited to XamlCompiler test and build infrastructure, but the affected test matrix is broad.

  • Low risk — isolated change, limited scope
  • Medium risk — touches shared components or public APIs
  • High risk — architectural or breaking API change

Potential regressions are limited to XamlCompiler solution configuration, test packaging, generated-output comparison, and architecture-specific test builds.

How Has This Been Tested?

  • I have performed a self-review of my own code
  • I have added tests to cover my changes
  • Existing tests pass locally

Validation performed:

  • amd64chk: XamlCompiler and test solutions build successfully.
  • amd64fre: XamlCompiler and test solutions build successfully with PGO disabled.
  • arm64ecchk: XamlCompiler and test solutions build successfully.
  • amd64chk and amd64fre: all 28 DiffCodegen tests pass.
  • Both unit-test runs report 290 passed, 4 skipped, and the same 4 known succinct-collection failures. The latter 4 known failures will be addressed in the future.

Screenshots (if appropriate)

N/A — no visual changes.

Delete retired UWP, Visual Basic, back-compat, dirs-based, and obsolete native test assets that are unsupported by WinUI 3.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Introduce shared project preambles, repository target frameworks, stable output paths, and deterministic Windows SDK resolution.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Port the native regression fixtures and missing scenario pages needed to replace C++/CX-only coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove the remaining C++/CX projects and modernize desktop packaging, managed projections, package declarations, and incremental fixtures.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Share one target mapping between generation and comparison, fail safely on incomplete refreshes, and regenerate the available masters.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update the unit-test payload and proxies, restore current expectations, and cache reusable schema state without losing isolation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Build authoring components for concrete architectures and repair WinUI TypeRef scopes in generated test WinMDs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the compiler built from the enlistment and add coverage for the C++/WinRT code-generation defects it exposes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Separate packaging intermediates, saved state, and duplicate fixture identities so sibling projects cannot contaminate each other.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Package the native BindTestbed directly, regenerate local-compiler masters, and re-enable all DiffCodegen cases.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the current C++/WinRT test package, integrate regression builds into Build.cmd, and refresh affected generated masters.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add regression coverage that keeps the generated metadata-provider API stable between XAML compiler passes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Simplify the command-line runner, assemble a complete test payload, and add explicit standalone and ARM64EC build mappings.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move test projects into their own solution and select codegen master roots from the active build flavor.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move the existing checked masters under their flavor root and add the generated free-build baselines.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Strengthen generated API and proxy checks, isolate outputs, make master refreshes atomic, and retain projection-header caching.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Regenerate the normal and incremental free-build baselines after the fixture removed four XAML lines.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the refreshed BindTestbed masters byte-identical to compiler output after patch normalization.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Regenerate the normal and incremental xProperties masters after the fixture shifted two source locations.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@evelynwu-msft
Evelyn Wu (evelynwu-msft) added this pull request to stack #11838 September 10, 2026 00:51
@evelynwu-msft
Evelyn Wu (evelynwu-msft) requested a review from a team as a code owner September 10, 2026 00:51
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@microsoft-github-policy-service microsoft-github-policy-service Bot added the needs-triage Issue needs to be triaged by the area owners label Sep 10, 2026
@evelynwu-msft

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
1 pipeline(s) were filtered out due to trigger conditions.

@evelynwu-msft

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
1 pipeline(s) were filtered out due to trigger conditions.

Comment thread Build.cmd
if not "%_nomock%"=="1" call :buildMockPackage
call :buildSolution %reporoot%\controls\MUXControls.sln /restore
if ERRORLEVEL 1 goto:showDurationAndExit
call :buildSolution %reporoot%\src\XamlCompiler\XamlCompilerTests.sln /restore

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

XamlCompilerTests.sln

What is the increase to build time you see for this on your machine? You mentioned that maybe we'd need to make this not always run so default build.cmd isn't significantly slowed. Is this still something which you think needs to be addressed?

(If so, one idea would be an init.cmd flag, similar to "/nopgo" where this compile can be disabled for individual build windows.)

@codendone Mike Crider (codendone) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good, with the comment for a suggestion of later cleanup. I assume this PR will be changed to retarget main after #11836 is completed. I'll approve once this is retargeted.

@@ -0,0 +1,70 @@
#pragma once

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of 715 files in the fre folder and 715 in the chk folder, only 35 files are different. This is a ton of duplication for these few differences. I suggest not blocking this PR for this, but it would be nice to have a follow-up change which either only forks the few projects which need a difference, or which allows override files to exist in the fre folder only for the files which have differences (this seems nicer).

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

Labels

needs-triage Issue needs to be triaged by the area owners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix XamlCompiler tests

2 participants