8000 Support Helix testing on CentOS Stream 9 by v-wuzhai · Pull Request #49194 · dotnet/sdk · GitHub
[go: up one dir, main page]

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

Conversation

v-wuzhai
Copy link
Member

No description provided.

@v-wuzhai
Copy link
Member Author
v-wuzhai commented May 29, 2025

@marcpopMSFT @MiYanni To fix the NativeAOT test failures on CentOS Stream 9, I added an install_dependencies() function in sdk/build/RunTestsOnHelix.sh to install zlib-devel and libunwind, and confirmed that the tests are now passing.

install_dependencies() {
  echo "Installing dependencies..."
  if [ -f /etc/os-release ]; then
    . /etc/os-release
    echo "Detected OS: $ID $VERSION_ID"
    case "$ID" in
      centos)
        sudo dnf install -y epel-release || echo "Warning: Failed to install epel-release"
        sudo dnf install -y zlib-devel libunwind || echo "Warning: Failed to install zlib-devel or libunwind"
        ;;
    esac
  else
    echo "Notice: /etc/os-release not found. Skipping dependency installation."
  fi
  echo "Dependencies installation complete."
}

install_dependencies

The dependency installation has also been ported to dotnet/dotnet-buildtools-prereqs-docker#1440.
Would you be able to take a look and review this update?

@v-wuzhai v-wuzhai marked this pull request as ready for review May 29, 2025 06:36
@Copilot Copilot AI review requested due to automatic review settings May 29, 2025 06:36
Copy link
Contributor
@Copilot 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

Adds support for running Helix tests on CentOS Stream 9 by updating OS detection logic, framework support checks, and the test pipeline configuration.

  • Extend IsRunningInContainer to detect CentOS alongside Debian/Ubuntu.
  • Update SupportsTargetFramework to include CentOS minimum framework version.
  • Enable container-based tests for CentOS Stream 9 in the SDK job matrix.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
test/dotnet.Tests/CommandTests/Workload/Restore/GivenDotnetWorkloadRestore.cs Expanded IsRunningInContainer to include CentOS detection
test/Microsoft.NET.TestFramework/EnvironmentInfo.cs Added a CentOS case for minimum target framework support
eng/pipelines/templates/jobs/sdk-job-matrix.yml Set runTests: true for CentOS Stream 9 and removed skip flags
Comments suppressed due to low confidence (3)

test/dotnet.Tests/CommandTests/Workload/Restore/GivenDotnetWorkloadRestore.cs:63

  • No tests cover the new CentOS branch in IsRunningInContainer. Add unit tests that simulate a CentOS environment to verify this code path.
if (!File.Exists("/.dockerenv"))

test/Microsoft.NET.TestFramework/EnvironmentInfo.cs:104

  • The new CentOS branch in SupportsTargetFramework isn’t covered by existing tests. Add a test case to verify that CentOS enforces the minimum framework version correctly.
else if (osId.Equals("centos", StringComparison.OrdinalIgnoreCase))

eng/pipelines/templates/jobs/sdk-job-matrix.yml:47

  • Remove the commented-out runTests: false lines now that CentOS tests are enabled, to keep the pipeline template clean and up to date.
#    runTests: false

Copy link
Member
@nagilson nagilson left a comment

Choose a reason for hiding this comment

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

LGTM after team triage discussion

@nagilson nagilson merged commit 6d995d4 into main Jun 3, 2025
31 checks passed
@nagilson nagilson deleted the dev/Jason/helix-centos-stream9-support branch June 3, 2025 20:18
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.

3 participants
0