Switch Unix builds to Roslyn.slnx and drive test platform selection via TFM#82989
Switch Unix builds to Roslyn.slnx and drive test platform selection via TFM#82989
Conversation
…lection Agent-Logs-Url: https://github.com/dotnet/roslyn/sessions/e4a96939-58da-44e0-8773-df8023435520 Co-authored-by: jaredpar <146967+jaredpar@users.noreply.github.com>
Agent-Logs-Url: https://github.com/dotnet/roslyn/sessions/b1ff163e-1780-44a0-969f-4bdd88ea82db Co-authored-by: jaredpar <146967+jaredpar@users.noreply.github.com>
…n Compilers.slnf Agent-Logs-Url: https://github.com/dotnet/roslyn/sessions/92a99a58-ee03-4cc9-b98d-b2959e899567 Co-authored-by: jaredpar <146967+jaredpar@users.noreply.github.com>
…ests rehydrate step Agent-Logs-Url: https://github.com/dotnet/roslyn/sessions/ddc03428-c1ba-416d-a46b-080360a74d5d Co-authored-by: jaredpar <146967+jaredpar@users.noreply.github.com>
|
Def think it will be good to be able to take this and then perhaps even start enabling tests on a project-by-project basis |
That is my plan. I have follow up PRs that do this. But I wanted to have a single change where keep the tests executed the same, just get us into the new approach |
RikkiGibson
left a comment
There was a problem hiding this comment.
Done review pass, I'd like to also compare the PR CI "before-and-after" when it is available
| <OutputType>Library</OutputType> | ||
| <RootNamespace>Microsoft.CodeAnalysis.Test.Utilities</RootNamespace> | ||
| <TargetFrameworks>$(NetRoslynAll);net472</TargetFrameworks> | ||
| <TargetFrameworks>$(NetRoslynWindows);net472</TargetFrameworks> |
There was a problem hiding this comment.
It feels like projects which don't contain tests, such as these .Utilities projects, shouldn't need to move to a windows-specific TFM.
There was a problem hiding this comment.
@copilot revert the changes to all the utilities projects.
There was a problem hiding this comment.
Reverted all IsTestUtilityProject projects back to their original cross-platform TFMs ($(NetRoslynAll);net472 or $(NetRoslyn)) in 6c9ecac. Test consumers handle platform selection via their own TFMs.
src/Tools/Source/RunTests/Program.cs
Outdated
| return RuntimeInformation.IsOSPlatform(OSPlatform.Windows); | ||
| } | ||
|
|
||
| if (tfmDirName.EndsWith("-linux", StringComparison.Ordinal)) |
There was a problem hiding this comment.
Is this a real TFM suffix? I didn't find it in https://learn.microsoft.com/en-us/dotnet/standard/frameworks#os-specific-tfms.
There was a problem hiding this comment.
That is one I didn't check because I thought for sure -linux was real. I agree it's not in that list but feels odd there is a -android but not -linux. @baronfel?
There was a problem hiding this comment.
We don't have a linux-specific surface area/framework, which is what drives the need most of these TFM-based suffixes. The entire feature mostly exists to trigger other extensibility mechanisms like workloads or FrameworkReferences.
There was a problem hiding this comment.
@copilot remove the -linux check as it's not a real TFM.
333fred
left a comment
There was a problem hiding this comment.
Feels like the blast radius of this is too large. I agree with the principles, but some of these test exclusions seem wrong to me.
| <OutputType>Library</OutputType> | ||
| <RootNamespace>Microsoft.CodeAnalysis.LanguageServer.Protocol.Test.Utilities</RootNamespace> | ||
| <TargetFrameworks>$(NetRoslynAll);net472</TargetFrameworks> | ||
| <TargetFrameworks>$(NetRoslynWindows);net472</TargetFrameworks> |
There was a problem hiding this comment.
Similarly here, thos doesn't seem like it needs to move.
There was a problem hiding this comment.
This job is trying to move us to the new way of deciding which tests run without actually changing what is running. This test didn't previously run on Linux hence moved to keep it not running on Linux. My later PR is going to come back and move the ones that can run on Linux over.
At first I tried to do this all in one PR, the review got big, decided to piece meal it.
| <PropertyGroup> | ||
| <StartupObject /> | ||
| <TargetFrameworks>$(NetRoslynAll);net472</TargetFrameworks> | ||
| <TargetFrameworks>$(NetRoslynWindows);net472</TargetFrameworks> |
There was a problem hiding this comment.
For these tests (CLASP, LanguageServer, Features tests), do we have a tracking issue for making them run on linux? These are absolutely things that should be testable on linux, since they run on linux.
There was a problem hiding this comment.
Ditto for the change of the LanguageServer project itself.
| <Project Sdk="Microsoft.NET.Sdk"> | ||
| <PropertyGroup> | ||
| <TargetFramework>$(NetRoslyn)</TargetFramework> | ||
| <TargetFramework>$(NetRoslynWindows)</TargetFramework> |
There was a problem hiding this comment.
What makes this only runnable on Windows?
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>$(NetRoslyn)</TargetFramework> | ||
| <TargetFramework>$(NetRoslynWindows)</TargetFramework> |
There was a problem hiding this comment.
What makes this only runnable on Windows?
| <Project Sdk="Microsoft.NET.Sdk"> | ||
| <PropertyGroup> | ||
| <TargetFramework>$(NetRoslyn)</TargetFramework> | ||
| <TargetFramework>$(NetRoslynWindows)</TargetFramework> |
There was a problem hiding this comment.
I'm pretty sure I ran these tests on Linux just a couple weeks ago.
…ject TFMs to cross-platform Agent-Logs-Url: https://github.com/dotnet/roslyn/sessions/66ff5f30-bc9a-474e-aaff-bd0500c36307 Co-authored-by: jaredpar <146967+jaredpar@users.noreply.github.com>
… NetRoslyn Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…NetRoslyn Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…o NetRoslyn Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Only real concern with this is a lot of tests projects are being marked windows only that I really would expect is already working. Frankly I'd rather review the big PR with a bunch of other changes than this where there's a bunch of head scratching. If it's easy enough to ask Copilot to either either:
- Convert projects back where the tests already 100% pass, or
- Add a comment to say at least one of the test that are failing and why.
Doesn't have to be a great explanation, but at least there's a bit of a pointer to why it has to stay that way.
| # This is a temporary step until the actual test run moves to helix (then we would need to rehydrate the tests there instead) | ||
| - task: BatchScript@1 | ||
| displayName: Rehydrate Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (net10.0) | ||
| displayName: Rehydrate Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (net10.0-windows) |
There was a problem hiding this comment.
This should run just fine on Linux/Mac. If this was a change you made just because it's in the Windows queue consider a revert, otherwise add this to your list to invesetigate.
There was a problem hiding this comment.
The details for why this fails on Linux are here.
| <PropertyGroup> | ||
| <StartupObject /> | ||
| <TargetFrameworks>$(NetRoslynAll);net472</TargetFrameworks> | ||
| <TargetFrameworks>$(NetRoslynWindows);net472</TargetFrameworks> |
There was a problem hiding this comment.
Ditto for the change of the LanguageServer project itself.
| return RuntimeInformation.IsOSPlatform(OSPlatform.Windows); | ||
| } | ||
|
|
||
| if (tfmDirName.EndsWith("-macos", StringComparison.Ordinal)) |
There was a problem hiding this comment.
Do we have any of these? Or just being complete?
…NetRoslynWindows to NetRoslyn Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…etRoslynWindows to NetRoslyn Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…slynWindows to NetRoslyn Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…oslyn Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…nWindows to NetRoslyn Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…oslynWindows to NetRoslyn Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
src/Workspaces/Remote/ServiceHubTest/Microsoft.CodeAnalysis.Remote.ServiceHub.UnitTests.csproj
Outdated
Show resolved
Hide resolved
src/Tools/ExternalAccess/RazorTest/Microsoft.CodeAnalysis.ExternalAccess.Razor.UnitTests.csproj
Outdated
Show resolved
Hide resolved
...otocol.Framework.UnitTests/Microsoft.CommonLanguageServerProtocol.Framework.UnitTests.csproj
Outdated
Show resolved
Hide resolved
Co-authored-by: Joey Robichaud <joseph.robichaud@microsoft.com>
This change reworks how our infra decides which tests run on which platform. Previously we just ran any test project in
Compilers.slnfon Unix. That meant though to increase the test projects we run on Unix we need to keep expandingCompilers.slnfwhich is not what that filter is for. After discussion we've decided to go the following route:Roslyn.slnx. This matches our Windows behavior and ensures we keep a clean build experience for our primary solution on both platforms.net9.0,net10.0, etc ...) will run on every platform. If you want a test project to only run on windows then use a platform specific TFM likenet10.0-windows.This job doesn't actually change what tests run on Unix, it's just taking our current state and moving to the new mechanism. A future change will start increasing our Unix test coverage.
After some offline discussion decided to just go ahead and enable test projects that can run on Unix without any changes as part of this PR. Have now done so. The result of the script to decide which did / didn't run without changes is
https://gist.github.com/jaredpar/6fbf7d90e92f9d37a4fdee75a51c75ad