Skip to content

Support Helix testing on CentOS Stream 9 #49194

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

Merged
merged 1 commit into from
Jun 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions eng/pipelines/templates/jobs/sdk-job-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ parameters:
container: centosStream9
helixTargetContainer: $(helixTargetContainerPrefix)centos-stream9-helix
osProperties: /p:OSName=linux
# Skipping all container-based testing for now.
# See: https://github.com/dotnet/sdk/issues/40935
runTests: false
runTests: true
- categoryName: ContainerBased
container: debian12Amd64
helixTargetContainer: $(helixTargetContainerPrefix)debian-11-helix-amd64
Expand Down
7 changes: 7 additions & 0 deletions test/Microsoft.NET.TestFramework/EnvironmentInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ public static bool SupportsTargetFramework(string targetFramework)
return false;
}
}
else if (osId.Equals("centos", StringComparison.OrdinalIgnoreCase))
{
if (nugetFramework.Version < new Version(2, 0, 0, 0))
{
return false;
}
}
else if (osId.Equals("debian", StringComparison.OrdinalIgnoreCase))
{
if (nugetFramework.Version < new Version(2, 0, 0, 0))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,14 @@ public void ProjectsThatDoNotSupportWorkloadsAndAreTransitivelyReferencedDoNotBr

private bool IsRunningInContainer()
{
return File.Exists("/.dockerenv") && (RuntimeInformation.OSDescription.Contains("Ubuntu") || RuntimeInformation.OSDescription.Contains("Debian"));
if (!File.Exists("/.dockerenv"))
{
return false;
}

string osDescription = RuntimeInformation.OSDescription.ToLowerInvariant();
return osDescription.Contains("centos") ||
osDescription.Contains("debian") ||
osDescription.Contains("ubuntu");
}
}
Loading