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

Đang mở Phù hợp với người mới
#253 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
csharp
Lĩnh vực
tooling

Hướng nghiên cứu

Logic phát hiện nằm ở _test_project trong project_validator/ecosystems/dotnet/tools.py (khoảng dòng 75-81), hiện yêu cầu tham chiếu Microsoft.NET.Test.Sdk hoặc thuộc tính Sdk MSTest.Sdk. Hãy đọc cùng với repro trong issue: một .csproj có xunit.v3 hoặc UseMicrosoftTestingPlatformRunner và một phương thức [Fact]. Hoàn thành khi dự án như vậy được nhận diện là dự án kiểm thử và có một bài kiểm thử bao phủ các tham chiếu gói xunit.v3, NUnit và MSTest.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Python
Star
4
Fork
1
Merge trung bình
10 giờ 41 phút
Pull request đã merge (30 ngày)
79

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của cpp-best-practices/project_validator

Tất cả issue của cpp-best-practices/project_validator

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.