Skip to content

Conversation

@agocke
Copy link
Member

@agocke agocke commented Oct 24, 2025

Reverts #120997

@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov
See info in area-owners.md if you want to be subscribed.

@agocke
Copy link
Member Author

agocke commented Oct 24, 2025

@jkoritzinsky Looks like the tests are trying to pull the host from NuGet, but I would expect the host to be part of our bootstrap. Is that correct? Or do we not yet build the host in the bootstrap?

@jkoritzinsky
Copy link
Member

It looks like we do build the host, but we don't hook up the right logic in targetingpacks.targets for the bootstrapped apphost to be found.

This target needs to be updated:

<Target Name="UpdateLocalAppHostPack"

It should do something like the target for the ref/targeting packs (use UseBootstrapLayout to determine which apphost to use):

<PropertyGroup Condition="'$(UseBootstrapLayout)' != 'true'">
<LocalRefPackDir>$(MicrosoftNetCoreAppRefPackDir)</LocalRefPackDir>
<LocalRuntimePackDir>$(MicrosoftNetCoreAppRuntimePackDir)</LocalRuntimePackDir>
</PropertyGroup>
<PropertyGroup Condition="'$(UseBootstrapLayout)' == 'true'">
<LocalRefPackDir>$(BootstrapRefPackDir)</LocalRefPackDir>
<LocalRuntimePackDir>$(BootstrapRuntimePackDir)</LocalRuntimePackDir>
</PropertyGroup>

@agocke agocke marked this pull request as ready for review December 1, 2025 23:25
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR reverts a previous revert to re-apply changes that move hosting tests from XUnit 2 to XUnit 3. The migration involves significant infrastructure and test code updates to support the new test framework version.

Key changes:

  • Migrates test projects to XUnit V3 with new package references and execution model (self-contained executables instead of dotnet test)
  • Renames TestContext to HostTestContext throughout all test files
  • Updates conditional test attributes to use Assert.SkipUnless pattern
  • Enhances Command class to support optional ITestOutputHelper for test output

Reviewed changes

Copilot reviewed 68 out of 68 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/installer/tests/helixpublish.proj Updates test execution to run tests as native executables with XUnit V3 CLI args
src/installer/tests/TestUtils/TestUtils.csproj Updates XUnit package references from v2 to v3
src/installer/tests/TestUtils/HostTestContext.cs Renames TestContext class to HostTestContext
src/installer/tests/TestUtils/Command.cs Adds optional ITestOutputHelper parameters for test output integration
src/installer/tests/HostActivation.Tests/*.cs Mass update of test references from TestContext to HostTestContext
src/installer/tests/Microsoft.NET.HostModel.Tests/*.cs Updates test attributes and context references for XUnit V3
src/installer/tests/AppHost.Bundle.Tests/*.cs Updates test attributes and context references for XUnit V3
src/installer/tests/Directory.Build.props Changes test filter syntax from v2 to v3 format, updates dump configuration
src/installer/tests/Directory.Build.targets Adds MSTest extensions for crash/hang dumps
src/installer/tests/Assets/Projects/Directory.Build.targets Simplifies build configuration for test asset projects
src/installer/pkg/sfx/**/*.props Updates targeting pack configuration for new build model
src/installer/Directory.Build.* Adds bootstrap layout support for platforms without LKG apphost

@agocke agocke merged commit 4909904 into main Dec 3, 2025
85 of 87 checks passed
@agocke agocke deleted the revert-120997-revert-120234-apphost-tests-xunit3 branch December 3, 2025 00:01
<Import Project="$(RepositoryEngineeringDir)liveBuilds.targets" />
<Import Project="$(RepositoryEngineeringDir)targetingpacks.targets" />

<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets, $(MSBuildThisFileDirectory)..))" />
Copy link
Member

Choose a reason for hiding this comment

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

@agocke this change looks wrong. Now these projects don't import the parent Directory.Build.targets file anymore but still the parent Directory.Build.props file.

Copy link
Member

@ViktorHofer ViktorHofer Dec 3, 2025

Choose a reason for hiding this comment

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

I noticed this as part of #121853 as properties like NETCoreAppMaximumVersion are not correctly set anymore.

Copy link
Member Author

Choose a reason for hiding this comment

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

No I think that’s right. These are test assets. I don’t think they should be importing the upwards targets file

Copy link
Member Author

Choose a reason for hiding this comment

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

It may be possible to import a specific targets file that provides a minimum set of functionality that we think should apply to tests, but the whole point of these projects is that they should be "normal" .NET projects that an everyday user would see. We do not want our targets files arbitrarily polluting their space.

Copy link
Member

Choose a reason for hiding this comment

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

Then they shouldn't even import any of the upwards props files. They must work without any of our custom defined settings. Also some of our props files must even have targets in them. I think you get my point. We need to be in synchronicity between D.B.props and D.B.targets.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that's probably right -- I didn't realize they import the props files. They shouldn't do that either.

Copy link
Member Author

Choose a reason for hiding this comment

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants