.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"

Aberta Para iniciantes
#253 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
72/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
csharp
Domínio
tooling

Direção de pesquisa

A lógica de detecção é _test_project em project_validator/ecosystems/dotnet/tools.py (por volta das linhas 75-81), que atualmente exige uma referência a Microsoft.NET.Test.Sdk ou um atributo de Sdk MSTest.Sdk. Leia-a junto com o repro da issue: um .csproj com xunit.v3 ou UseMicrosoftTestingPlatformRunner e um método [Fact]. Está pronto quando um projeto assim é reconhecido como projeto de testes e um teste cobre as referências de pacotes xunit.v3, NUnit e MSTest.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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

Linguagem predominante
Python
Estrelas
4
Forks
1
Merge médio
10h 41min
PRs com merge (30d)
79

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de cpp-best-practices/project_validator

Todas as issues de cpp-best-practices/project_validator

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.