.NET test projects are recognised only via an explicit Microsoft.NET.Test.Sdk reference: xunit.v3 + Microsoft.Testing.Platform and Arcade SDK projects have "no tests"

Aperta Adatta ai principianti
#253 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
tooling

Direzione di ricerca

La logica di rilevamento è _test_project in project_validator/ecosystems/dotnet/tools.py (circa righe 75-81), che attualmente richiede un riferimento a Microsoft.NET.Test.Sdk oppure un attributo Sdk MSTest.Sdk. Leggila insieme al repro della issue: un .csproj con xunit.v3 o UseMicrosoftTestingPlatformRunner e un metodo [Fact]. È completata quando un progetto del genere viene riconosciuto come progetto di test e un test copre i riferimenti ai pacchetti xunit.v3, NUnit e MSTest.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Humanizer (161 files with [Fact], xunit.v3 on Microsoft.Testing.Platform) and dotnet/command-line-api (53 files, Arcade SDK where the test SDK is implicit) get FAIL "no tests found ([Fact], [Test] or [TestMethod] methods in a test project (one referencing Microsoft.NET.Test.Sdk))". A project with [Fact]/[Test] methods and an xunit/NUnit/MSTest package reference is a test project.

Evidence from the corpus audit

Humanizr/Humanizer, dotnet/command-line-api / tests-run
  • kind: FALSE_NEGATIVE
  • actual: FAIL: .NET: no tests found ([Fact], [Test] or [TestMethod] methods in a test project (one referencing Microsoft.NET.Test.Sdk)) (both projects)
  • expected: tests found: Humanizer has 161 files with [Fact] in an xunit.v3 / Microsoft.Testing.Platform project; command-line-api has 53 in Arcade SDK projects, where the test SDK is implicit.
  • evidence: Humanizer tests/Humanizer.Tests/Humanizer.Tests.csproj:6-7: <TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport> / <UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>; :19: <PackageReference Include="xunit.v3.mtp-v2" />. command-line-api Directory.Build.props:3: <Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" />; src/System.CommandLine.Tests/System.CommandLine.Tests.csproj:1: <Project Sdk="Microsoft.NET.Sdk"> with no test-SDK reference. Validator: project_validator/ecosystems/dotnet/tools.py:75-81 _test_project requires PackageReference == "Microsoft.NET.Test.Sdk" or Sdk starting with MSTest.Sdk.
  • repro: a .csproj with <PackageReference Include="xunit.v3" /> (or UseMicrosoftTestingPlatformRunner) and a .cs with [Fact].
  • confidence: high

Found by the regression-corpus audit (235 real repositories, one or more per ecosystem profile; corpus and expected results in corpus/). Evidence is quoted from the audited checkouts at the commits pinned in corpus/projects.toml; <checkouts>/<owner>__<repo> is such a checkout.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ByTXNqDWdM7HzezrFtEvQt

Lingua principale
Python
Stelle
4
Fork
1
Merge medio
10h 41m
PR unite (30g)
79

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cpp-best-practices/project_validator

Tutte le issue di cpp-best-practices/project_validator

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.