Test discovery fails on .NET 10 SDK for xunit.v3/MTP projects: 'Testing with VSTest target is no longer supported'
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
調査の方向性
Start by tracing SharpLsp’s test discovery path and the related MTP work in #249 and #574. Check how it identifies project capabilities and chooses between VSTest and MTP, including the IsTestingPlatformApplication property and global.json setting described here. Done when supported MTP projects can be discovered through MTP without that setting, while projects that still need VSTest retain the fallback.
索引モデルが issue の本文から書いたものです。
説明
Summary
Test Explorer tries to discover xunit.v3 tests through the old VSTest runner, which no longer works for xunit.v3 projects. It should use the new Microsoft.Testing.Platform (dotnet test MTP) runner wherever the project supports it, and fall back to VSTest only for projects that still need it.
On the .NET 10 SDK, Test Explorer can't discover tests in an xunit.v3 test project whose repo has no global.json opting in to Microsoft.Testing.Platform. The discovery path goes through VSTest, so MSBuild errors out, the test tree shows "Test discovery failed — SharpLsp could not enumerate tests for /Tests.csproj", and no tests are listed.
Environment
- macOS (Darwin 25.6), .NET SDK 10.0.403
xunit.v34.0.3,xunit.runner.visualstudio4.0.1,Microsoft.NET.Test.Sdk- The test project has
OutputType=Exe. The repo has noglobal.jsonand noUseMicrosoftTestingPlatformRunner/TestingPlatformDotnetTestSupportproperties.
Repro
- Create a test project:
<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>net10.0</TargetFramework> <OutputType>Exe</OutputType> </PropertyGroup> <ItemGroup> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="*" /> <PackageReference Include="xunit.v3" Version="4.0.3" /> <PackageReference Include="xunit.runner.visualstudio" Version="4.0.1" /> </ItemGroup> </Project> - Open the folder in VS Code with SharpLsp and open Test Explorer.
Actual
Test Results output:
Determining projects to restore...
All projects are up-to-date for restore.
~/.nuget/packages/microsoft.testing.platform.msbuild/2.5.2/buildMultiTargeting/Microsoft.Testing.Platform.MSBuild.targets(395,5): error : Testing with VSTest target is no longer supported by Microsoft.Testing.Platform on .NET 10 SDK and later. If you use dotnet test, you should opt-in to the new dotnet test experience. For more information, see https://aka.ms/dotnet-test-mtp-error [.../Tests.csproj]
The tree shows the "Test discovery failed" node. The SharpLsp output channel logs nothing about the failure, only the routine workspace/diagnostics/* and ping sidecar traffic every 2s.
Expected
SharpLsp should see that the project is an MTP project (because it references Microsoft.Testing.Platform.MSBuild, for example through xunit.v3 or TUnit, or because IsTestingPlatformApplication=true) and discover and run its tests through MTP (<exe> --list-tests / server mode) instead of the VSTest target. This should work whether or not the repo's global.json opts in with "test": { "runner": "Microsoft.Testing.Platform" }. Failing that, the error node should say exactly what to change, and the output channel should log the failure.
Related: #249 (MTP support), #574 (MTP build preflight errors).
- 主要言語
- TypeScript
- スター
- 185
- フォーク
- 12
- 平均マージ
- 7時間 33分
- マージ済み PR(30日)
- 63
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Nimblesite/SharpLsp のほかの issue
-
Fix All + Enforce overwrites unsaved edits to .editorconfig / Directory.Build.props / sharplsp.tomlオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
Nimblesite/SharpLsp#644 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Nimblesite/SharpLsp#641 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
Nimblesite/SharpLsp#640 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
Nimblesite/SharpLsp#639 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
Nimblesite/SharpLsp#510 ·
メンテナーはふだん 1 日以内に返信
Nimblesite/SharpLsp の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
audacity/audacity.github.io#118 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
crxjs/chrome-extension-tools#1261 ·
-
Resources: Update work of fuzhou対応中かも @rmt-svc が今日担当しました。 オープンresources
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
railmapgen/rmp-gallery#4245 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
mike-north/AgentMonitors#717 ·
メンテナーはふだん 1 日以内に返信