Skip to content

feat(mutation-testing): map test files to a dotnet test project and filter behind tests - #10332

Merged
melodic-automation-lanes[bot] merged 3 commits into
mainfrom
work-resolve-issue/issue-9686-40372897042-1
Oct 26, 2026
Merged

melodic-automation-lanes[bot] merged 3 commits into
mainfrom
work-resolve-issue/issue-9686-40372897042-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #9686

Summary

Opened by the work-resolve-issue lane. The run's own summary:

Adds scripts/dotnet-test-selection.sh, which groups C# test files by their nearest .csproj and prints one shell-quoted line per project: the project path and a --filter of FullyQualifiedName~<Namespace>.<Class>. terms, one per top-level class. When test-command starts with dotnet test, the audit runs it once per printed line in place of {tests} and never without a project argument, and setup now proposes dotnet test {tests}. A test with a three-project fixture (one library, two xUnit test projects) covers the script; when dotnet is on PATH it also runs dotnet test on each printed line and checks the passed count.

Not verified

  • bash plugins/mutation-testing/scripts/dotnet-test-selection.test.sh was not run: this lane's Bash runs only the named wrappers, so no suite and no dotnet could run here. The script and test were traced by hand twice (once by me, once by the fresh-context reviewer). Left to the PR's CI test lanes, wh
  • bash scripts/affected-tests.sh --run (the issue's last Done-when check) was not run here for the same reason; check-affected in this lane runs without --tests. Left to the PR's CI.
  • The dotnet half of the test (eval of dotnet test &lt;line one&gt; and the passed-count assertion) runs only on a runner with dotnet on PATH and NuGet access. Whether CI's test runner has dotnet is unverified; without it the test prints a skip line and the count assertion does not run. It also reli
  • The &lt;Class&gt;+ term for nested classes is a hedge: no page read this run states how the xUnit VSTest adapter spells a nested class in FullyQualifiedName. The fixture's nested test makes the dotnet run check it.
  • CI-only gates not runnable here (from check-affected's CI-only list): typos, changed-skills/skill-quality, orphaned-fixtures, discriminating-test-skips, silent-skips, test-tmp-cleanup, selector-live and the rest. The fixtures sit under scripts/fixtures, outside the orphaned-fixtures scope. The test
  • No commit made: the lane instructions say to leave every change uncommitted for the runner's patch, and no commit tool was provided.

Fix

  • plugins/mutation-testing/scripts/dotnet-test-selection.sh: new script. Walks up to the nearest *.csproj, parses file-scoped and block namespaces and top-level classes with an awk scanner that skips comments, string/char/verbatim/raw literals and preprocessor lines. Prints '<project>' --filter
  • plugins/mutation-testing/scripts/dotnet-test-selection.test.sh: new black-box test (test-scope declares the fixture tree). Asserts the exact two lines for one file from each fixture project and their quoted-.csproj plus --filter 'FullyQualifiedName~ shape. Also covers same-project grouping and dedup
  • plugins/mutation-testing/scripts/fixtures/dotnet-test-selection/**: Shop library, Shop.Tests (file-scoped CalculatorTests with a nested class, plus the decoy CalculatorTestsExtra) and Shop.Specs (block-namespace file with two classes, plus OtherSpecs). The xUnit projects use the package versions fro
  • plugins/mutation-testing/skills/audit/SKILL.md: Runner and regime runs the script over the test set when test-command starts with dotnet test. It runs test-command once per line (any red run makes the set red), refuses a baseline in which no test matched the filter and refuses on a script error, a
  • plugins/mutation-testing/skills/audit/context/tool-test-restriction.md: the .NET row names the per-project expansion, the nested and generic term forms, keeping --filter out of test-command, and that a filter matching nothing exits 0. Sources and recheck trigger added.
  • plugins/mutation-testing/skills/setup/SKILL.md: apply step 6 proposes dotnet test {tests} for the dotnet test runner and still proposes nothing for Maven/Gradle. Check step 4 runs a .NET baseline once per test project, never over a solution.
  • plugins/mutation-testing/skills/setup/templates/config-template.md: test-command comment names dotnet test {tests} as the one name-filter form.
  • plugins/mutation-testing/README.md: Configuration bullet notes the per-project dotnet expansion.
  • .changes/mutation-testing/feat-9686-dotnet-test-selection-3b8e51d7.md: minor-bump changelog fragment, written by hand because new-changelog-fragment refused the detached HEAD.

Verification

The runner ran each check from the base copy against 7070f59:

  • scripts/check-changelog-fragments.sh --check: passed

The run reports:

  • .lane/checks/bin/check-changelog-fragments: all 3 fragments valid (run after the final edits)
  • .lane/checks/bin/check-affected: 10 passed, 6 skipped, 0 failed over 16 changed files (markdown, shellcheck, shell-portability, exec-bit, changelog-fragments, stale-base-overlap, spoke-plugin-root, plugin-options-docs, changelog-parity and validate-plugins ran; ruff had no .py, typos is not installe
  • .lane/verify/bin/cant-fail-scan --file plugins/mutation-testing/scripts/dotnet-test-selection.test.sh --check: PASS, no gating findings
  • Grep for 'dotnet test {tests}' in plugins/mutation-testing/skills/setup/SKILL.md: line 146 matches (the issue's git grep check)
  • Fresh-context review subagent over the whole diff: no blocking bug, with every expect traced by hand. Fixed the findings I confirmed: nested-class tests (now a <Class>+ term, plus a nested test in the fixture), a filter matching nothing exits 0 (the audit refuses such a baseline), the awk name
  • read https: //learn.microsoft.com/en-us/dotnet/core/testing/selective-unit-tests: --filter is <Property><Operator><Value>[|&<Expression>]; ~ is contains, | is or; xUnit supports FullyQualifiedName; filter escape sequences cover \ ( ) & | = ! ~
  • read https: //learn.microsoft.com/en-us/dotnet/core/tools/dotnet-test-vstest: the PROJECT argument is a path to the test project, and omitting it means the current directory. A run that matches no tests warns and exits 0. The --logger trx and --results-directory options and the sample xUnit csproj (
  • read https: //learn.microsoft.com/en-us/dotnet/core/tools/dotnet-test: VSTest is the default runner; Microsoft.Testing.Platform is opted into through global.json in the .NET 10 SDK
  • read https: //learn.microsoft.com/en-us/dotnet/core/tools/dotnet-test-mtp: under MTP the project is given by --project or a positional project path, and test options depend on registered extensions. The expansion is documented as the VSTest form.
  • read https: //github.com/microsoft/vstest/blob/main/docs/report.md: documents the console and TRX loggers, with no sample of the summary line. The test therefore reads the TRX Counters element rather than console text.
  • read https: //learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-csharp-with-xunit: xUnit test project layout (dotnet new xunit packages); no console summary format given
  • read https: //learn.microsoft.com/en-us/dotnet/api/system.type.fullname: a generic type definition's FullName carries an arity suffix (List1). The page does not state the nested-type separator, so the script emits both <Class>.and<Class>+` rather than relying on one.
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/40372897042

Left out: the items under Not verified.

Related

#9686

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 627c8a8a63ec204ce70d65c80694fb16ac3d9750: 0 finding(s), 0 as inline comments.

Incremental security review (91a3d7a → 627c8a8): no security issues found.

Scope: plugins/mutation-testing/skills/audit/SKILL.md and plugins/mutation-testing/skills/audit/context/tool-test-restriction.md. Neither matches a trusted path.

The change moves the .NET test-set paragraph out of the audit skill's Runner and regime step into a new "Running a .NET test set" section in tool-test-restriction.md. SKILL.md now links to that section.

Instruction-surface check: every removed rule is still stated in the new section.

  • Run scripts/dotnet-test-selection.sh from the directory test-command runs in.
  • Run test-command once per printed line, and treat any red run as a red set.
  • Refuse on a non-zero exit from the script.
  • Refuse a baseline in which no test matched the filter. The new text adds the reason: a filter that matches nothing exits 0.
  • Never run dotnet test without a project argument.

The single-quote shell-quoting rule for test paths ('\'' escape) stays in SKILL.md, unchanged. So do the refusal conditions for a missing or non-conforming test-command and the "never switched mid-run" rule. Nothing the removed text forbade is now permitted. I did not consult docs/conventions/instruction-exception-register/README.md, so the protected-class list was not checked.

manifest: no manifest files are touched, so there are no manifest <field> lines.
Cost: nothing here is spend beyond prepaid or subscription usage, so there is no hold.
PR context: no embedded directives aimed at the lane.

critical-findings: 0

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 627c8a8a63ec204ce70d65c80694fb16ac3d9750: 0 finding(s), 0 as inline comments.

Incremental review of 91a3d7a..627c8a8, which touches two files and finds no issues.

The change moves the .NET test-set procedure out of skills/audit/SKILL.md ("Runner and regime") into a new "Running a .NET test set" section in context/tool-test-restriction.md. SKILL.md now keeps the trigger (test-command starts with dotnet test), the script invocation and the pointer to the section.

I read both files at head and compared the moved text with the removed text. Every rule survives in the new section:

  • The script runs from the directory test-command runs in.
  • test-command runs once per printed line, and any red run makes the set red.
  • A non-zero script exit refuses.
  • A baseline that matches no test refuses. The new text adds the reason: a filter that matches nothing still exits 0.
  • dotnet test never runs without a project argument.

plugins/mutation-testing/scripts/dotnet-test-selection.sh exists. The section's anchor name matches the heading, and the "Recheck trigger" note matches the table row. Long lines in SKILL.md are not a lint problem, since .markdownlint-cli2.jsonc sets MD013 to false.

The earlier-reviewed files are unchanged since the last review. Nothing in this delta is a trusted-path file, a manifest change or a cost change. The closing issue #9686 sets no new acceptance criterion this delta affects.

I did not run anything. The PR's own verification claims are author-claimed and unverified here.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head 91a3d7a4cf0ca0ab126324bb76dbc23c9133e40f. The lanes clear this reason on their own; the next scheduled run judges it again.

pr-merge's gate refuses its verifier verdict (verify:missing)

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 627c8a8a63ec204ce70d65c80694fb16ac3d9750.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Oct 26, 2026
Merged via the queue into main with commit 586c8ab Oct 26, 2026
37 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-9686-40372897042-1 branch October 26, 2026 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(mutation-testing): map test files to a dotnet test project and filter behind {tests}

0 participants