Skip to content

Update .NET SDK to 10.0.101 and use MTP#6393

Open
Youssef1313 wants to merge 2 commits intonpgsql:mainfrom
Youssef1313:patch-1
Open

Update .NET SDK to 10.0.101 and use MTP#6393
Youssef1313 wants to merge 2 commits intonpgsql:mainfrom
Youssef1313:patch-1

Conversation

@Youssef1313
Copy link

@Youssef1313 Youssef1313 commented Dec 25, 2025

This PR updates .NET SDK from 10.0.100 to 10.0.101, as well as moving from VSTest to Microsoft.Testing.Platform (the newer modern alternative)

@Youssef1313 Youssef1313 force-pushed the patch-1 branch 2 times, most recently from f558c0a to 130fb65 Compare December 25, 2025 15:34
run: |
dotnet test -c ${{ matrix.config }} -f ${{ matrix.test_tfm }} test/Npgsql.Tests --logger "GitHubActions;report-warnings=false" --blame-hang-timeout 30s
dotnet test -c ${{ matrix.config }} -f ${{ matrix.test_tfm }} test/Npgsql.DependencyInjection.Tests --logger "GitHubActions;report-warnings=false"
dotnet test -c ${{ matrix.config }} -f ${{ matrix.test_tfm }} --no-build --no-progress --project test/Npgsql.Tests --hangdump --hangdump-timeout 30s
Copy link
Author

Choose a reason for hiding this comment

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

Note 1: GitHubActions logger of VSTest doesn't yet support MTP. Not sure if you consider the lack of it as a blocker. Alternatively, you can report TRX files and use https://github.com/marketplace/actions/publish-test-results instead.

@Youssef1313 Youssef1313 marked this pull request as ready for review December 25, 2025 15:39
Copilot AI review requested due to automatic review settings December 25, 2025 15:39
Copy link

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

This PR updates the .NET SDK from version 10.0.100 to 10.0.101 and migrates the test infrastructure from traditional test runners to the Microsoft Testing Platform (MTP).

Key Changes:

  • Updated .NET SDK version to 10.0.101 in global.json and added MTP runner configuration
  • Removed Microsoft.NET.Test.Sdk, GitHubActionsTestLogger, and xunit.runner.visualstudio packages
  • Added MTP-specific packages: Microsoft.Testing.Extensions.HangDump for NUnit projects and YTest.MTP.XUnit2 for xUnit projects
  • Configured test projects with OutputType=Exe and enabled MTP properties in Directory.Build.props

Reviewed changes

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

Show a summary per file
File Description
global.json Updated SDK version to 10.0.101 and configured Microsoft Testing Platform as the test runner
Directory.Packages.props Removed traditional test packages (Microsoft.NET.Test.Sdk, xunit.runner.visualstudio, GitHubActionsTestLogger) and added MTP packages (Microsoft.Testing.Extensions.HangDump, YTest.MTP.XUnit2)
test/Directory.Build.props Removed GitHubActionsTestLogger reference and added MTP-specific MSBuild properties (EnableNUnitRunner, UseMicrosoftTestingPlatformRunner)
test/Npgsql.Tests/Npgsql.Tests.csproj Added OutputType=Exe property and Microsoft.Testing.Extensions.HangDump package for MTP support
test/Npgsql.Specification.Tests/Npgsql.Specification.Tests.csproj Added OutputType=Exe property and replaced xunit.runner.visualstudio with YTest.MTP.XUnit2 adapter
test/Npgsql.PluginTests/Npgsql.PluginTests.csproj Added OutputType=Exe property and removed Microsoft.NET.Test.Sdk package
test/Npgsql.DependencyInjection.Tests/Npgsql.DependencyInjection.Tests.csproj Added OutputType=Exe property and removed Microsoft.NET.Test.Sdk package
test/Npgsql.NativeAotTests/Npgsql.NativeAotTests.csproj Removed GitHubActionsTestLogger package reference exclusion
.github/workflows/build.yml Updated test commands to use new MTP-specific flags (--hangdump, --hangdump-timeout) and added --no-build, --no-progress options

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@roji
Copy link
Member

roji commented Dec 26, 2025

@Youssef1313 can you provide a bit of context for this change and/or point towards some explanations? Am not familiar with MTP, Microsoft.Testing.Extensions.HangDump, etc.

@Youssef1313
Copy link
Author

Microsoft.Testing.Extensions.HangDump is the package that provides --hangdump and friends.

The core MTP doesn't have any dependencies and provides the minimal core to discover/run tests along with some built in features. Other extensions are implemented in separate packages, especially when they require additional dependencies. This keeps the core MTP clean without any dependencies, and you pull additional dependencies only when you need to use extra features.

Copilot AI review requested due to automatic review settings December 27, 2025 13:24
Copy link

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

Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings December 28, 2025 08:48
Copy link

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

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (2)

test/Npgsql.PluginTests/Npgsql.PluginTests.csproj:15

  • The Npgsql.Tests project includes Microsoft.Testing.Extensions.HangDump and Microsoft.Testing.Extensions.CrashDump packages for MTP support. These packages should also be added to Npgsql.PluginTests to maintain consistency across all NUnit-based test projects and enable the crashdump and hangdump functionality that is being used in the CI workflow.
  <ItemGroup>
    <PackageReference Include="NetTopologySuite" />
    <PackageReference Include="NodaTime" />
    <PackageReference Include="NUnit" />
    <PackageReference Include="NUnit.Analyzers">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
    <PackageReference Include="NUnit3TestAdapter" />

test/Npgsql.DependencyInjection.Tests/Npgsql.DependencyInjection.Tests.csproj:15

  • The Npgsql.Tests project includes Microsoft.Testing.Extensions.HangDump and Microsoft.Testing.Extensions.CrashDump packages for MTP support. These packages should also be added to Npgsql.DependencyInjection.Tests to maintain consistency across all NUnit-based test projects and enable the crashdump and hangdump functionality that is being used in the CI workflow.
  <ItemGroup>
    <PackageReference Include="Microsoft.Extensions.DependencyInjection" />
    <PackageReference Include="Microsoft.Extensions.Logging" />
    <PackageReference Include="NUnit" />
    <PackageReference Include="NUnit.Analyzers">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
    <PackageReference Include="NUnit3TestAdapter" />

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 301 to 315
- name: Test
run: dotnet test -c ${{ matrix.config }} -f ${{ matrix.test_tfm }} --no-build --no-progress --project test/Npgsql.Tests --crashdump --hangdump --hangdump-timeout 30s
shell: bash

- name: Test DependencyInjection
run: dotnet test -c ${{ matrix.config }} -f ${{ matrix.test_tfm }} --no-build --no-progress --project test/Npgsql.DependencyInjection.Tests --crashdump --hangdump --hangdump-timeout 30s
shell: bash

- name: Test Plugins
if: "!startsWith(matrix.os, 'macos')"
run: |
dotnet test -c ${{ matrix.config }} -f ${{ matrix.test_tfm }} test/Npgsql.Tests --logger "GitHubActions;report-warnings=false" --blame-crash --blame-hang-timeout 30s
dotnet test -c ${{ matrix.config }} -f ${{ matrix.test_tfm }} test/Npgsql.DependencyInjection.Tests --logger "GitHubActions;report-warnings=false"
if [ -z "${{ matrix.pg_prerelease }}" ]; then
dotnet test -c ${{ matrix.config }} -f ${{ matrix.test_tfm }} --no-build --no-progress --project test/Npgsql.PluginTests --crashdump --hangdump --hangdump-timeout 30s
fi
shell: bash
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

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

The Npgsql.Specification.Tests project has been migrated to use Microsoft.Testing.Platform, but there is no corresponding test step for this project in the GitHub Actions workflow. The three test steps added only cover Npgsql.Tests, Npgsql.DependencyInjection.Tests, and Npgsql.PluginTests. Either add a test step for Npgsql.Specification.Tests or clarify in the PR description why it's being excluded.

Copilot uses AI. Check for mistakes.
@roji
Copy link
Member

roji commented Dec 28, 2025

Putting this on hold for now until microsoft/testfx#6968 it fixed (hopefully in Microsoft.Testing.Extensions.HangDump 2.0.3) - hangdump currently isn't working, and we have a flaky test hanging, causing the entire build to hang indefinitely (before this PR with the older vstest, at least we get a failure after 30s).

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.

2 participants