-
Notifications
You must be signed in to change notification settings - Fork 384
Move tests and test debuggees to repo root 'tests' directory #5554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…es with build in them. Flags as duplicate params
… (NuGet.config, Version.props, and a debuggee Directory.Build.props+targets)
There was a problem hiding this 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.
There was a problem hiding this 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.
src/tests/DbgShim.UnitTests/ConfigFiles/Windows/Debugger.Tests.Config.txt
Outdated
Show resolved
Hide resolved
src/tests/DbgShim.UnitTests/ConfigFiles/Windows/Debugger.Tests.Config.txt
Outdated
Show resolved
Hide resolved
<Import ConfigFile="Debugger.Tests.Common.txt" /> | ||
<DotNetRoot>$(RepoRootDir)/.dotnet-test</DotNetRoot> | ||
<Import ConfigFile="$(DotNetRoot)/Debugger.Tests.Versions.txt" /> | ||
<DotNetRoot Condition="'$(TestDotNetRoot)' != ''">$(TestDotNetRoot)</DotNetRoot> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I see in the logic, DotNetRoot gets set to the env var DOTNET_ROOT before we start parsing the config file. TestDotNetRoot gets set from Debugger.Tests.Common.txt which was generated in the build and points to the '.dotnet-test' folder. If the files were then copied to helix and run with DOTNET_ROOT set it looks like the final result would be ".dotnet-test" which isn't the behavior we want right?
I was expecting this would be something like "<DotNetRoot Condition='$(DotNetRoot)'==''>$(DefaultDotNetRoot) where DefaultDotNetRoot = $(RepoRoot).dotnet-test[\x86]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll revert this change as it doesn't really apply until #5560
VisualStudioVersion = 17.12.35309.182 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestDebuggee", "src\SOS\lldbplugin.tests\TestDebuggee\TestDebuggee.csproj", "{6C43BE85-F8C3-4D76-8050-F25CE953A7FD}" | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestDebuggee", "src\tests\Debuggees\TestDebuggee\TestDebuggee.csproj", "{6C43BE85-F8C3-4D76-8050-F25CE953A7FD}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I understand the reason we are moving all the debuggees around is to facilitate carving up the bin directory into smaller per-test artifacts that can be sent to Helix. I'd propose we start with a simpler model and then observe what performance we are getting before doing further optimization:
- Package up the entire artifacts/bin into a single bundle (I'm seeing 280MB compressed)
- We can still choose to send that bundle to multiple machines and run a single test project on each if we want (at least I assume we can do that).
- That should eliminate the need to move files around, track which projects depend on which assets, or create any complicated bundling logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get what you're after. I'll tweak this to have the artifacts land where they normally would and then we can address in #5560
<DotNetRoot>$(RepoRootDir)/.dotnet-test</DotNetRoot> | ||
<Import ConfigFile="$(DotNetRoot)/Debugger.Tests.Versions.txt" /> | ||
<DotNetRoot Condition="'$(TestDotNetRoot)' != ''">$(TestDotNetRoot)</DotNetRoot> | ||
<Import ConfigFile="$(TestVersionConfigDir)/Debugger.Tests.Versions.txt" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels weird that we've got some tests looking for this version file in one place (.dotnet-test) and other tests looking for it in artifacts\bin. Even if it is hard-coded for now, can we get them all pointing to the same place and remove the versions.config.txt being produced in .dotnet-test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be easier to revert this change as it doesn't really apply until #5560.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That works too.
<Import ConfigFile="Debugger.Tests.Common.txt" /> | ||
<DotNetRoot>$(RepoRootDir)/.dotnet-test</DotNetRoot> | ||
<Import ConfigFile="$(DotNetRoot)/Debugger.Tests.Versions.txt" /> | ||
<DotNetRoot Condition="'$(TestDotNetRoot)' != ''">$(TestDotNetRoot)</DotNetRoot> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I see in the logic, DotNetRoot gets set to the env var DOTNET_ROOT before we start parsing the config file. TestDotNetRoot gets set from Debugger.Tests.Common.txt which was generated in the build and points to the '.dotnet-test' folder. If the files were then copied to helix and run with DOTNET_ROOT set it looks like the final result would be ".dotnet-test" which isn't the behavior we want right?
I was expecting this would be something like "<DotNetRoot Condition='$(DotNetRoot)'==''>$(DefaultDotNetRoot) where DefaultDotNetRoot = $(RepoRoot).dotnet-test[\x86]
<FileWrites Include="$(DebuggerVersionConfigFileName)" /> | ||
</ItemGroup> | ||
</Target> | ||
</Project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to comment on the *.UnitTest renames but GH won't let me add a comment there.
I'd suggest if we rename these projects we should use ".Tests" instead of ".UnitTests". Many of these tests are more accurately described as functional or integration tests rather than unit tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me.
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:
Build.proj
traversal project that includes all main diagnostic tool projects and conditionally includes test projects, improving build orchestration and clarity.Directory.Build.props
to setIsShipping
andIsPackable
tofalse
by default, and suppress warnings about packing non-packable projects, ensuring that internal/test projects are not accidentally shipped or packed.Test Infrastructure and Project Structure:
add_subdirectory(tests)
toCMakeLists.txt
to ensure that test projects are included in native builds.debuggees.sln
to reference test debuggee projects from the newtests/Debuggees
directory, and added several new test debuggee projects to the solution.THIRD-PARTY-NOTICES.TXT
to point to the new location of theXunit.Extensions
code undertests/Microsoft.Diagnostics.TestHelpers
, reflecting the directory reorganization.edited version of Move tests and test debuggees to repo root 'tests' directory #5469