Test discovery fails on .NET 10 SDK for xunit.v3/MTP projects: 'Testing with VSTest target is no longer supported'
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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).
- Lingua principale
- TypeScript
- Stelle
- 185
- Fork
- 12
- Merge medio
- 7h 33m
- PR unite (30g)
- 63
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Nimblesite/SharpLsp
-
Fix All + Enforce overwrites unsaved edits to .editorconfig / Directory.Build.props / sharplsp.tomlApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
Nimblesite/SharpLsp#644 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Nimblesite/SharpLsp#641 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Nimblesite/SharpLsp#640 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Nimblesite/SharpLsp#639 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Nimblesite/SharpLsp#510 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Nimblesite/SharpLsp
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
audacity/audacity.github.io#118 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
crxjs/chrome-extension-tools#1261 ·
-
Resources: Update work of fuzhouForse già presa @rmt-svc l’ha presa oggi. Apertaresources
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
railmapgen/rmp-gallery#4245 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
mike-north/AgentMonitors#717 ·
I maintainer di solito rispondono entro 1 giorno