Skip to content

Conversation

max-charlamb
Copy link
Member

@max-charlamb max-charlamb commented Aug 28, 2025

This pull request reorganizes and improves the project and build configuration, with a particular focus on test infrastructure and project structure. The changes streamline how test projects are referenced and built, clarify property settings for packaging and shipping, and update solution/project references to reflect a new directory structure for test assets.

Project and Build Configuration Improvements:

  • Added a new Build.proj traversal project that includes all main diagnostic tool projects and conditionally includes test projects, improving build orchestration and clarity.
  • Updated Directory.Build.props to set IsShipping and IsPackable to false by default, and suppress warnings about packing non-packable projects, ensuring that internal/test projects are not accidentally shipped or packed.
  • Added architecture-specific properties for test .NET install roots and registry roots, improving test environment configuration for different target architectures.

Test Infrastructure and Project Structure:

  • Added add_subdirectory(tests) to CMakeLists.txt to ensure that test projects are included in native builds.
  • Updated the Visual Studio solution file debuggees.sln to reference test debuggee projects from the new tests/Debuggees directory, and added several new test debuggee projects to the solution.
  • Corrected a path in THIRD-PARTY-NOTICES.TXT to point to the new location of the Xunit.Extensions code under tests/Microsoft.Diagnostics.TestHelpers, reflecting the directory reorganization.edited version of Move tests and test debuggees to repo root 'tests' directory #5469

@max-charlamb max-charlamb marked this pull request as ready for review August 28, 2025 21:46
@max-charlamb max-charlamb requested a review from a team as a code owner August 28, 2025 21:46
@max-charlamb max-charlamb changed the title Prepare tests to run on helix Move tests and test debuggees to repo root 'tests' directory Aug 28, 2025
steveisok
steveisok previously approved these changes Aug 29, 2025
@steveisok steveisok self-requested a review August 29, 2025 22:28
steveisok
steveisok previously approved these changes Aug 29, 2025
Copy link
Member

@noahfalk noahfalk left a comment

Choose a reason for hiding this comment

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

What is the rationale for moving stuff in \src\tests -> \tests? For example dotnet\runtime or dotnet\aspnetcore both put their tests under the src directory. It seems like this creates a lot of churn and makes our repo different than others.

I'm not necessarily opposed but I do want to understand before we churn 100s of files in the repo versioning history. I just marked request changes to make sure it doesn't get accidentally checked in before we talked about it.

@steveisok steveisok self-requested a review September 4, 2025 23:42
Copy link
Member

@steveisok steveisok left a comment

Choose a reason for hiding this comment

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

I think we're good now.

<TestDotNetRootDir>$(DotNetInstallRoot)</TestDotNetRootDir>
<TestPackageArtifactsRootDir>$(NuGetPackageRoot)</TestPackageArtifactsRootDir>
<TestAuxMSBuildRootDir>$(AuxMSBuildRootDir)</TestAuxMSBuildRootDir>
<TestVersionConfigDir>$(ArtifactsBinDir)</TestVersionConfigDir>
Copy link
Member

Choose a reason for hiding this comment

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

What causes Debugger.Tests.Versions.txt to be located in the artifacts bin dir? I thought this is a file we create when we install the runtimes to test.

Copy link
Member

Choose a reason for hiding this comment

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

Since there will be two modes of running tests, it made sense to decouple generating this file from when we install the runtimes. When we build tests for helix, installing runtimes at that point is useless.

Copy link
Member

@noahfalk noahfalk Sep 5, 2025

Choose a reason for hiding this comment

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

A couple thoughts:

  1. Could you or Max make a little doc in our repo that describes how we expect the Helix testing to work? I'm hoping this wouldn't need to be more than a few paragraphs describing what assets are going to be put in what places and how are the different pieces going to find what they need. Right now its challenging to reconstruct the high level design intent from the fragments of scripts and paths spread around the repo.
  2. When we set up a Helix run I assume we have some control over where the runtime gets copied to and where the Debugger.Tests.Versions.txt file gets copied to. Certainly we don't have to put those two things in the same place but is it problematic to do so? The fewer different directories and variables we need the simpler it is to keep track of.
  3. ArtifactsBinDir initially seems like a surprising place to have the versions file but maybe its just because I don't understand the bigger picture of how the Helix testing is intended to work. I'm trusting once I see how the pieces fit together it will make more sense.

<DotNetRoot Condition="'$(TargetArchitecture)' == 'x86'">$(RepoRootDir)\.dotnet-test\x86</DotNetRoot>
<Import ConfigFile="$(DotNetRoot)\Debugger.Tests.Versions.txt" />
<DotNetRoot Condition="'$(TestDotNetRoot)' != ''">$(TestDotNetRoot)</DotNetRoot>
<Import ConfigFile="$(TestVersionConfigDir)\Debugger.Tests.Versions.txt" />
Copy link
Member

Choose a reason for hiding this comment

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

For the SOS tests we assume this file is in DotNetRoot directory. Why have different tests looking in different directories?

(I notice this pattern of parameterizing the DbgShim tests differently than the SOS tests occurs in other places too but I'm guessing there is no benefit to commenting each spot)

Copy link
Member

Choose a reason for hiding this comment

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

We took an earlier commit from #5469 as it started to get too much from one PR. This will be the way we want to have the debugger type tests configured moving forward. DbgShim was the first one and SOS just hadn't been done yet.

It would be easier to leave this change in my opinion as we're going to follow up with similar behavior in the other tests.

Copy link
Member

Choose a reason for hiding this comment

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

Got it, the differences are because its only partially complete. 👍

<DotNetRoot Condition="'$(TargetArchitecture)' != 'x86'">$(RepoRootDir)\.dotnet-test</DotNetRoot>
<DotNetRoot Condition="'$(TargetArchitecture)' == 'x86'">$(RepoRootDir)\.dotnet-test\x86</DotNetRoot>
<Import ConfigFile="$(DotNetRoot)\Debugger.Tests.Versions.txt" />
<DotNetRoot Condition="'$(TestDotNetRoot)' != ''">$(TestDotNetRoot)</DotNetRoot>
Copy link
Member

Choose a reason for hiding this comment

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

The SOS tests have hard-coded $(RepoRootDir)/.dotnet-test as DotNetRoot. Any reason DbgShim tests are doing all this parameterization and the SOS tests are essentially hard-coding it? It seems like we'd want all our tests looking for DotNetRoot in the same place.

Copy link
Member

Choose a reason for hiding this comment

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

Similar comment as the one above. The rationale for creating $(TestDotNetRoot) is local = '.dotnet-test' and helix = 'read from DOTNET_ROOT env variable'. All debugger tests will opt into this behavior.

@@ -1,14 +1,14 @@
<Configuration>
<Import ConfigFile="Debugger.Tests.Common.txt" />
<DotNetRoot>$(RepoRootDir)/.dotnet-test</DotNetRoot>
<Import ConfigFile="$(DotNetRoot)/Debugger.Tests.Versions.txt" />
<DotNetRoot Condition="'$(TestDotNetRoot)' != ''">$(TestDotNetRoot)</DotNetRoot>
Copy link
Member

Choose a reason for hiding this comment

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

I assume the design intent is that TestDotNetRoot won't be defined when running Helix? Its not yet clear to me why that will be the case, but I'm hoping things will make sense once I've got a better understanding how the Helix run is executed.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, that's the only thing that can't be relative pathed. When the sdk is sent along, the DOTNET_ROOT env variable is also set. We can just read from the env variable in that case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants