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

未关闭 适合新手
#253 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
csharp
领域
tooling

调研方向

检测逻辑是 project_validator/ecosystems/dotnet/tools.py 中的 _test_project(约第 75-81 行),目前要求存在 Microsoft.NET.Test.Sdk 引用或 MSTest.Sdk 的 Sdk 属性。请结合 issue 中的复现示例阅读:一个包含 xunit.v3 或 UseMicrosoftTestingPlatformRunner 且带有 [Fact] 方法的 .csproj。完成的标准是:此类项目被识别为测试项目,并且有一个测试覆盖 xunit.v3、NUnit 和 MSTest 的包引用。

由索引模型根据 Issue 内容生成。

描述

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

主要语言
Python
星标
4
派生
1
平均合并
10 小时 41 分钟
30 天内合并 PR
79

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

cpp-best-practices/project_validator 的其他 Issue

查看 cpp-best-practices/project_validator 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。