Skip to content

Audit Cannot See an IsTestProject-Only C# Test Project, and validate-task.yml Keeps a Header Summary Block #1259

Description

@ptr727

Two findings raised on #1255 that the change there fixed only as far as a tree read can reach.

1. A C# test project neither named nor located as a test is invisible

spec/audit.py's is_csharp_test_project() decides "this repo has C# tests" from the file tree alone: a .csproj whose filename contains Test, or one sitting under a directory segment named test or tests. That covers App.Tests.csproj, App.UnitTest.csproj, and test/Specs.csproj.

It does not cover a project that declares <IsTestProject>true</IsTestProject> while being named and placed like any other, src/Integration/Integration.csproj being the reachable shape. Such a repo reads as having no C# tests, so the audit drops its Codecov claim and reports codecov.yml N/A. That is a silent false clean, which is the failure direction coverage_claiming_types()'s own docstring says to avoid.

The fix needs project contents, not paths, and the audit reads the tree in one call precisely to avoid a per-file fetch. Options, roughly in cost order:

  1. Read only the .csproj files the tree already lists, which is a handful per repo, and look for IsTestProject or a test-package reference. Bounded, but it is a new per-file fetch loop in a function that currently makes one call.
  2. Keep the C# claim unconditionally and apply the tests-aware narrowing to Python only, on the grounds that spec/audit.py requires Codecov of build-profile Python repos that have no tests #1224's reachable shape was a package-only Python library. Loses the C# half of that fix.
  3. Leave it and record the limit, which is the state today.

2. The validator's own header comment is a summary block

.github/workflows/validate-task.yml opens with a header comment enumerating its three jobs and what each contains. The comment-and-doc-style contract says: "No file, class, or type header summary blocks. A type or file gets a comment only for a specific non-obvious point, never a block restating what it contains."

The block predates #1255, which only corrected one stale phrase inside it, so removing it is its own change. It is worth doing deliberately rather than as a drive-by, because the file is the fleet's shared validator and several repos read it as the reference shape.

Provenance

Both were raised by Qodo on #1255. The reachable half of finding 1, a project named App.UnitTest.csproj or located under test/, was fixed there along with the matching Python gap, where a root-level test_app.py or app_test.py suite had read as testless.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions