Update .NET SDK to 10.0.101 and use MTP#6393
Update .NET SDK to 10.0.101 and use MTP#6393Youssef1313 wants to merge 2 commits intonpgsql:mainfrom
Conversation
f558c0a to
130fb65
Compare
.github/workflows/build.yml
Outdated
| 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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, andxunit.runner.visualstudiopackages - Added MTP-specific packages:
Microsoft.Testing.Extensions.HangDumpfor NUnit projects andYTest.MTP.XUnit2for xUnit projects - Configured test projects with
OutputType=Exeand 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.
|
@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. |
|
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. |
There was a problem hiding this comment.
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.
test/Npgsql.DependencyInjection.Tests/Npgsql.DependencyInjection.Tests.csproj
Show resolved
Hide resolved
There was a problem hiding this comment.
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.
| - 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 |
There was a problem hiding this comment.
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.
|
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). |
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)