diff --git a/catalog/Testing/Official-DotNet-Test/skills/run-tests/SKILL.md b/catalog/Testing/Official-DotNet-Test/skills/run-tests/SKILL.md index f77df06..0cb915b 100644 --- a/catalog/Testing/Official-DotNet-Test/skills/run-tests/SKILL.md +++ b/catalog/Testing/Official-DotNet-Test/skills/run-tests/SKILL.md @@ -1,16 +1,14 @@ --- name: run-tests description: >- - ALWAYS USE before running .NET tests or answering with a test command or - flags. Trigger on "run the tests", "exact dotnet test command", one - test/class/category/trait/target framework, combined filters, - `--filter-query`, `--no-build`, `--diag`, diagnostic logs, TRX, coverage - collection, crash/hang dumps, filter errors, or unrecognized options. Chooses - repository-compatible classic, VSTest, bridged MTP, or native MTP syntax for - MSTest/xUnit/NUnit/TUnit. DO NOT USE for platform identification alone - (platform-detection), writing or debugging test code, interpreting an - existing coverage report, CI investigation, migration, or a persistent hot - reload/watch loop. + Chooses .NET test commands when running tests is the task. For routine + reproduction and verification during application fixes, use the usual repo + command or `dotnet test`; choosing your own filter does not by itself warrant + loading this skill. Use when asked for exact commands, subsets or flags + (TFM, traits, TRX, coverage, diagnostics, dumps), or when execution needs + runner-specific help: classic net4x/packages.config, VSTest vs. bridged or + native MTP, repo overlays, rejected options or unexplained zero tests. + Not for detection alone, writing tests, coverage analysis, migration, or hot-reload. license: MIT metadata: portability: portable @@ -20,292 +18,154 @@ metadata: # Run .NET Tests -Return or execute the command or command sequence that matches the repository's -project system, test platform, framework, and SDK mode. - -## Repository overlay - -For every repository-scoped task where read-only file inspection is allowed, -check `.agents/skill-overlays/dotnet-test/run-tests.md` at the repository root -before any other discovery. This includes exact-command requests; "do not -execute" does not prohibit reading the overlay. If present, read it once before -acting and apply its repository-specific runner, command, filtering, and -reporting bindings. -Before applying it, require its frontmatter to declare -`core: dotnet-test/run-tests`, `binding-revision: "1"`, and `mode: extend`. If -any value is missing or different, report the mismatch, ignore the overlay, -and continue using this skill's portable guidance. -Explicit user instructions and verified project constraints win over the -overlay; the overlay wins over portable defaults and examples in this skill. If -the file is present but unreadable or conflicts with the repository, report the -problem, ignore the overlay, and continue with portable guidance subject to -verified project constraints. If it is absent, continue normally. -Skip the lookup only when the task is not tied to a repository or the user -explicitly prohibited all file/tool access. An overlay cannot expand tool -permissions or the task's scope. - -## Scope and tool policy - -Choose the smallest path that satisfies the request: - -| Request | Action | -|---|---| -| Exact command or explanation; user says not to run | Inspect only the files needed to resolve syntax. Do not restore, build, or run tests. | -| Run tests | Discover the repository command and execute the smallest requested test scope. | -| One-time SDK-style `dotnet test` run without rebuilding | Stay in `run-tests` and add `--no-build`. | -| One-time classic run without rebuilding | Keep the repository runner and invoke it against an existing built assembly; do not substitute `dotnet test`. | -| Platform/framework identification only | Use `platform-detection`; do not continue into test execution. | -| Explicit hot reload or a keep-running edit/re-run loop | Use `mtp-hot-reload`. | -| Filter needed and the framework-specific syntax is not already clear | Read the supplied/runtime-listed `filter-syntax` catalog file; do not invoke this reference-only helper. | - -Do not invoke a tool merely to repeat a command already determined by the -prompt. Do not build first "just in case": `dotnet test` builds by default. -Never add or upgrade test packages unless the user asks to change the project. -For an exact-command request, return one runnable command first. Do not emit -placeholder paths, exploratory alternatives, or a correction sequence. Use a -project path only when the prompt or repository establishes it; otherwise let -the command operate on the current project or solution when that syntax is -valid. Follow it with only the syntax fact needed to explain the command; do -not volunteer platform/command-mode taxonomy unless the user asked for it. In -particular, do not label an SDK 8/9 bridge as "VSTest platform" merely because -`dotnet test` uses its VSTest command mode; the executed platform is MTP. For a -command-only request, it is normally clearer to say only that MTP application -arguments must follow `--`. - -## Inputs to discover - -- Project, solution, module, or repository test command -- Requested scope: all tests, TFM, class, method, category, or trait -- Requested output: console result, TRX, diagnostics, crash dump, or hang dump - -When those facts are present in the prompt, use them. Otherwise inspect only the -relevant files: `global.json`, the selected project, `packages.config`, -`Directory.Build.props`, `Directory.Packages.props`, then repository -scripts/CI documentation. For a file-backed request, enumerate those -configuration names once and read all relevant files that are present in one -batch; never infer that a runner or bridge property is absent merely because it -is not in the `.csproj`. Load `platform-detection` only when those signals need -precedence analysis; do not duplicate its full analysis in the response. -If execution is requested and the command depends on the active SDK but neither -the prompt nor `global.json` establishes it, run `dotnet --version` once. For a -command-only request that prohibits execution, do not probe: state the required -SDK assumption or ask for the SDK version when the syntax cannot otherwise be -resolved. Route identification-only requests to `platform-detection`. - -## Decision table - -| Detected mode / platform | Command shape | Never use | -|---|---|---| -| Classic non-SDK | Repository script, or full MSBuild followed by `vstest.console.exe` / `MSTest.exe` | Assuming `dotnet test` is compatible or migrating implicitly | -| VSTest mode / VSTest | `dotnet test [] [VSTEST_OPTIONS]` | MTP-only flags such as `--report-trx` or `--treenode-filter` | -| VSTest mode / executable MTP bridge | `dotnet test [] [DOTNET_OPTIONS] -- [MTP_OPTIONS]` | Omitting the `--` separator, including on SDK 10 | -| Native MTP mode, SDK 10+ | `dotnet test --project [DOTNET_OPTIONS] [MTP_OPTIONS]` | Bare positional project paths or the bridge separator | - -`global.json` controls the `dotnet test` command mode on SDK 10+, not -necessarily the platform that executes tests. A VSTest-mode project with an MTP -runner, `TestingPlatformDotnetTestSupport=true`, and final `OutputType=Exe` is -still bridge syntax with `--`. SDK 8/9 only has VSTest command mode. - -`--project` is valid only in SDK 10+ **native MTP command mode** (selected by -`global.json` `test.runner`). Never use it for VSTest mode or an SDK 8/9 bridge; -those forms take a positional project path. Conversely, native MTP options are -direct arguments and must not be placed after a bridge separator. - -Keep `dotnet test`/MSBuild options such as `--framework`, `--configuration`, -`--no-build`, and `--verbosity` before `--`. Put only MTP application arguments -after `--` in bridge mode. +Return or execute the narrowest test command matching the repository's project +system, test platform, framework, and SDK command mode. + +## Rules + +- **Advisory requests** (command without running): use only read-only file + tools (never invoke `bash`, `powershell`, or any shell — not even for `ls`, + `find`, `cat`, or a read-only `git` query), and never restore, build, or run tests. + Return a single runnable command (or an ordered restore/build/test sequence + for classic projects) for the detected or stated mode; never append + alternative commands for other platforms/modes or placeholder paths + (``, ``, `path/to/...`). If no test target path is + given or found and the current directory is a clear default, omit `--project` + and any test target path from `dotnet test` or `dotnet run` (see Step 5). +- **Execution requests**: run only the smallest requested scope. Do not run a + separate `dotnet build` before `dotnet test` unless passing `--no-build`. + Never add or upgrade test packages unless asked. +- **Verify execution**: a zero-test run does not verify the code, even at exit + 0. For a filtered run, confirm the reported names or counts match the scope. + Distinguish restore/build failures from test failures. +- **One-time no-rebuild runs**: add `--no-build` to the selected `dotnet test` + command (not `dotnet watch`), or before `--` in `dotnet run` for TUnit. For + classic projects, run the existing assembly or report the missing build. ## Workflow -1. **Resolve the repository-compatible runner.** - -For classic projects, signals include `ToolsVersion`, explicit `Compile` and -`Reference` items, legacy imports, and `packages.config`. Prefer a checked-in -script or documented CI command. A typical fallback is: - -```powershell -nuget restore MySolution.sln -MSBuild.exe MySolution.sln /t:Build /p:Configuration=Debug -vstest.console.exe path\to\MyTests.dll /TestAdapterPath:path\to\adapter\build\ -``` - -For `packages.config`, restore with NuGet before the build unless the imported -package files are already present. If adapter discovery is not repository- -configured, derive `/TestAdapterPath` from the restored adapter package path or -the adapter `.props`/`.targets` imports; do not guess the package root. - -For a requested no-rebuild run, omit the build step and invoke the repository's -test runner only when the expected assembly already exists. Otherwise report the -missing build output rather than silently rebuilding or switching runners. - -For a requested subset, keep the repository runner and use its filter syntax: -`vstest.console.exe path\to\MyTests.dll -/TestCaseFilter:"TestCategory=Integration"`. Older `MSTest.exe` repositories may -use `/test:` or `/category:` instead. Do not substitute the -later `dotnet test` filter examples for a classic runner. - -Use the installed adapter-compatible VSTest/MSTest toolchain. If it is not -available, state the missing prerequisite and the documented command; do not -claim tests ran. -Classic `packages.config` fallback commands are Windows toolchain commands. -Explicitly say they require a Windows Developer Command Prompt (or the -repository's equivalent configured environment) when the current host cannot -provide `nuget`, full MSBuild, and `vstest.console.exe`. - -For SDK-style projects, distinguish: - -| Signal | Meaning | -|---|---| -| SDK 10+ `global.json` selects `Microsoft.Testing.Platform` | Native MTP command mode | -| VSTest mode + enabled MTP runner + final `TestingPlatformDotnetTestSupport=true` + final `OutputType=Exe` | Executable VSTest-to-MTP bridge | -| VSTest mode without a complete runner-and-bridge combination | VSTest | -| `Microsoft.NET.Test.Sdk` plus adapter, without stronger MTP signals | VSTest | -| `TUnit` | MTP-only; use a configured bridge/native mode or the test executable | - -Evaluate properties from the project and imported -`Directory.Build.props`/`Directory.Packages.props`. Respect project-level -overrides and per-target-framework conditions. A runner and bridge without an -executable final output are an incomplete MTP configuration, not a usable -bridge. - -2. **Select the command and requested scope.** - -```shell -# VSTest mode -dotnet test path/to/Tests.csproj - -# VSTest mode that bridges to MTP -dotnet test path/to/Tests.csproj -- - -# Native MTP mode on SDK 10+ -dotnet test --project path/to/Tests.csproj - -# One target framework; this stays before the bridge separator -dotnet test path/to/Tests.csproj --framework net9.0 -- -``` - -For native MTP, use `--project`, `--solution`, or `--test-modules`; positional -paths belong to VSTest mode. - -If the user names a subset, do not run the whole suite. Inspect test attributes -only when needed to translate a human label such as "integration" or "smoke" -into the framework's actual category/trait name. - -When a VSTest class filter must distinguish similarly named classes, combine -the positive selector with an explicit negative selector rather than relying on -an incidental substring difference. - -3. **Apply platform- and framework-correct filters.** - -Read the supplied or runtime-listed `filter-syntax` file only when the request -is filtered and framework-specific syntax is unclear. It is reference-only, -not an invocable skill; otherwise use the common decisions below: - -For a file-backed filtered request, resolve the framework and SDK command mode -from the project, `global.json`, and imported props before choosing syntax. -Do not infer VSTest syntax merely from `Microsoft.NET.Test.Sdk` or from the -framework name. - -| Platform / framework | Filter | -|---|---| -| VSTest with MSTest, xUnit v2, or NUnit | `--filter ""` | -| MTP with MSTest or NUnit | Same expression; after `--` in bridge mode, direct in native mode | -| MTP with xUnit v3 | `--filter-class`, `--filter-method`, `--filter-trait`, or one `--filter-query` for a combined expression | -| MTP with TUnit | `--treenode-filter` path expression | - -Examples: - -```shell -# VSTest MSTest/NUnit -dotnet test --filter "FullyQualifiedName~OrderServiceTests&TestCategory=Unit" - -# SDK 8/9 or SDK 10 VSTest-mode MTP bridge, xUnit v3 -dotnet test -- --filter-trait "Category=Integration" - -# Native MTP, xUnit v3 -dotnet test --project Tests.csproj --filter-class "*ShoppingCartTests*" - -# One xUnit v3 combined expression -dotnet test -- --filter-query "/*/*/*Integration*/*[Category=Smoke]" - -# TUnit on SDK 8/9 with a configured VSTest-to-MTP bridge -dotnet test -- --treenode-filter "/*/*/SmsNotificationTests/*" - -# TUnit executable fallback when no bridge is configured -dotnet run --project Tests.csproj -- --treenode-filter "/*/*/SmsNotificationTests/*" -``` - -Do not use VSTest `--filter "ClassName=..."` with xUnit v3 on MTP. Do not use a -generic VSTest expression with TUnit. -When the user requests one combined xUnit query expression, return only one -`--filter-query` command; do not replace it with separate filter flags or offer -speculative alternative grammars. - -4. **Add reports or diagnostics.** - -| Outcome | VSTest | MTP | -|---|---|---| -| TRX | SDK-style: `--logger "trx;LogFileName=.trx"` when an exact output file is requested, otherwise `--logger trx`; standalone `vstest.console.exe`: `/Logger:trx`; `MSTest.exe`: repository-documented results option | `--report-trx` | -| Results directory | `--results-directory ` | `--results-directory ` | -| Diagnostic log | `--diag ` | `--diagnostic --diagnostic-output-directory ` | -| Crash dump | `--blame-crash` | `--crashdump` | -| Hang timeout | `--blame-hang --blame-hang-timeout 5min` | `--hangdump --hangdump-timeout 5min` | -| Code coverage | `--collect "Code Coverage"` | `--coverage` | - -MTP report, dump, and coverage flags require their corresponding registered -extensions (`TrxReport`, `CrashDump`, `HangDump`, or `CodeCoverage`). Some -framework SDKs bundle common extensions; if a flag is unrecognized, inspect -package references before recommending a package change. - -`--verbosity diagnostic` increases dotnet/MSBuild output verbosity; it does not -write a VSTest diagnostic log file. - -Examples: - -```shell -# VSTest TRX -dotnet test Tests.csproj --logger "trx;LogFileName=TestResults.trx" - -# MTP bridge TRX -dotnet test Tests.csproj -- --report-trx - -# Native MTP TRX and hang detection -dotnet test --project Tests.csproj --report-trx --hangdump --hangdump-timeout 5min - -# Native MTP diagnostics -dotnet test --project Tests.csproj --diagnostic --diagnostic-output-directory artifacts/diagnostics -``` - -5. **Execute only when requested.** - -Run the narrowest command or sequence that answers the request. Capture each -command, exit code, and test summary. A failed restore/build is not a test -failure, and a test failure is not a tool failure. Report which phase failed and -include the actionable diagnostic. Never claim a clean run unless the sequence -completed successfully with the intended tests executed. -For a filtered run, a successful exit is not enough: confirm the reported test -names or count match the requested scope. If the filter was ignored, correct the -platform-specific syntax and rerun before reporting success. - -## Output contract - -- Command-only request: lead with the exact command or command sequence, then - one short syntax explanation. -- Execution request: report the exact command or command sequence and - a literal `Passed: N, Failed: N, Skipped: N` summary from the completed run; - include the first actionable failure. -- Detection needed only to choose syntax: state the selected mode/platform - briefly, not a separate detection report. -- Missing prerequisite or incompatible configuration: name it explicitly and - stop rather than returning a success-shaped fallback. - -## Validation - -- The command matches classic, VSTest, bridged MTP, or native MTP mode. -- The framework-specific filter targets the requested subset. -- `--framework` and other `dotnet test` options are before any bridge separator. -- SDK 8/9 bridge commands contain `--`; `--project` appears only in SDK 10+ - native MTP mode. -- TRX, diagnostics, dump, and coverage flags match the platform. -- No restore, build, or test was run for an advisory-only request. -- Reported results match the actual command outcome. +1. **Inspect the workspace.** + + Before answering, inspect the **current working directory (not the skill + directory)**. Skip inspection when the user forbids file reads or asks for + an answer from supplied content only, and honor those limits in later steps + too. "Do not run the tests" alone still permits read-only inspection. Also + skip inspection for advisory requests that explicitly + state the test platform, applicable SDK command mode, and framework and do + not refer to the current project or repository. + + In one parallel batch using file-search/read tools (such as `glob`, `grep`, + and `view` — not a shell), check the current working directory for project + files, `packages.config`, `global.json`, `Directory.Build.props`, + `Directory.Build.targets`, and `Directory.Packages.props`, plus the direct + overlay read below. If host/session context or the prompt establishes an + ancestor repository root above the current working directory, keep project + discovery scoped to the working directory and include in the same batch + applicable ancestor `global.json`, `Directory.Build.*`, and + `Directory.Packages.props` up to that root. Otherwise, treat the current + working directory as the root and do not probe parent directories; if the + working directory is a filesystem root (such as `/`), skip directory + discovery and inspect only paths named by the user. Never guess VSTest when + project files exist in the workspace. If that batch finds no project files + for an advisory request, do not retry project discovery; still apply any + valid overlay or repo script/CI check if applicable, otherwise answer from + the prompt. Resolve properties in MSBuild import order with per-TFM + conditions; a property absent from `.csproj` may come from an import. + Consult `platform-detection` internally when available only if precedence, + defaults, or conflicts remain unclear (do not duplicate its analysis). For + repo entry-point requests, if initial reads and any valid overlay do not + define one, check repo scripts/CI docs (`eng/`, `build.*`, + `.github/workflows/`) under the resolved repository root (skipping if at a + filesystem root); if none define one, return the resolved portable command + and label it portable. Run `dotnet --version` only when executing and + neither prompt nor `global.json` sets the SDK. + + **Optional repository overlay:** Whenever workspace inspection is not + skipped by the rule above (and the resolved root is not a filesystem root), + always read `.agents/skill-overlays/dotnet-test/run-tests.md` at the + resolved repository root directly with a file-read tool — even if you + already listed the directory, because directory listings omit hidden + `.agents/` folders. If present, require YAML frontmatter + `core: dotnet-test/run-tests`, `binding-revision: "1"`, and `mode: extend`. + When valid and repo-consistent, apply its bindings + (precedence: user > verified repo constraints > overlay > portable defaults; + overlays cannot expand permissions, scope, filesystem/network access, or + publication authority). If the overlay is unreadable, has a missing or + mismatched required field, or conflicts with the repo, report the specific + problem (explicitly call an unsupported revision a `binding-revision` + mismatch), ignore the overlay, and continue with portable guidance. + +2. **Match command shape to project system and SDK mode.** + + | Mode / platform | Signals | Command shape | Never use | + |---|---|---|---| + | Classic non-SDK | `ToolsVersion`, explicit `Compile`/`Reference`, `packages.config` | Repo script, or `nuget restore` + `MSBuild.exe` + `vstest.console.exe` (`/TestCaseFilter:`, `/TestAdapterPath:`, `/Logger:trx`); `MSTest.exe` (`/test:`, `/category:`) only if repo-established | `dotnet test` or implicit migration | + | VSTest mode (VSTest) | VSTest mode + VSTest-capable SDK-style project with `UseVSTest=true` or no enabled MTP runner/bridge pair | `dotnet test [] [VSTEST_OPTIONS]` (plus `-- ` only for inline RunSettings, e.g. `dotnet test -- MSTest.MapInconclusiveToFailed=true`) | `--project`, `--` for non-RunSettings options, or MTP flags (even after `--`) | + | VSTest mode (bridged MTP) | SDK 8/9, or SDK 10+ with MTP 1.x and VSTest command mode (selected in `global.json` or used by default); enabled MTP runner, `TestingPlatformDotnetTestSupport=true`, `OutputType=Exe`, no `UseVSTest=true` | `dotnet test [] [DOTNET_OPTIONS] -- [MTP_OPTIONS]` | `--project` or MTP flags without `--` | + | Native MTP (SDK 10+) | SDK 10+ `global.json` `"test": { "runner": "Microsoft.Testing.Platform" }` (never from `TargetFramework=net10.0` alone) + `Exe` MTP app (no `UseVSTest=true`) | `dotnet test [--project ] [DOTNET_OPTIONS] [MTP_OPTIONS]` (or `--solution`/`--test-modules`) | Bare positional path, `--`, or VSTest-only flags | + | TUnit without bridge/native | `TUnit` (MTP-only) without `global.json` native MTP or `TestingPlatformDotnetTestSupport=true` (even on `net10.0`) | `dotnet run [--project ] -- [MTP_OPTIONS]` (include `--project ` whenever a target project path is given or found in the workspace; omit it only when none is given or found and the current directory is a clear default) | `dotnet test` | + + - In **VSTest mode (bridged MTP)**, put `dotnet test`/MSBuild options + (`--framework `, `--configuration`, `--no-build`, `--verbosity`) + **before** `--`, and MTP options (including `--results-directory`) + **after** `--`. + - On SDK 10+, MTP 2.x rejects the VSTest bridge; report the incompatibility + instead of giving a bridged command. In native MTP mode, report incompatible + projects or `UseVSTest=true` rather than falling back to VSTest. Runner + + bridge without `OutputType=Exe` is incomplete. + - For classic `packages.config`, derive `/TestAdapterPath:` from restored + packages or `.props`/`.targets` imports and note the Windows Developer + Command Prompt requirement when unavailable. + +3. **Apply framework-specific filters.** + + Read the supplied or runtime-listed `filter-syntax` reference (never invoke + as a skill) only when complex filter grammar is still unclear. + + | Platform / framework | Filter syntax | + |---|---| + | VSTest (MSTest, xUnit, NUnit) | `--filter ""` (`=`, `!=`, `~`, `!~`, `&`, `\|`). MSTest/NUnit: `TestCategory`, `FullyQualifiedName` (MSTest: `ClassName`); xUnit: trait name (e.g. `Category`), `FullyQualifiedName`. Quote `&`/`\|`. Combine positive + negative selectors for similar class names. | + | MTP + MSTest / NUnit | Same `--filter ""` (`TestCategory=...`), after `--` in bridge mode or direct in native mode. Never `--filter-class` for NUnit. | + | MTP + xUnit v3 | `--filter-class`, `--filter-method`, `--filter-trait "Key=Value"`, or one `--filter-query "////[Trait=Val]"` for a single combined expression. Never VSTest `--filter`. | + | MTP + TUnit | `--treenode-filter "////[Prop=Val]"` (`/*/*/*/*[Category!=Slow]` across suite; `/*/*/ClassName/*` for a class). Never VSTest `--filter`. | + + ```shell + dotnet test --filter "FullyQualifiedName~OrderServiceTests&TestCategory=Unit" # VSTest MSTest/NUnit + dotnet test -- --filter-trait "Category=Integration" # Bridged MTP xUnit v3 + dotnet test -- --filter-query "/*/*/*Integration*/*[Category=Smoke]" # Bridged MTP xUnit v3 query + dotnet test --project Tests.csproj --filter-class "*ShoppingCartTests*" # Native MTP xUnit v3 + dotnet run -- --treenode-filter "/*/*/*/*[Category!=Slow]" # TUnit fallback (no bridge/native) + dotnet run --project TestProject.csproj -- --treenode-filter "/*/*/SmsNotificationTests/*" + ``` + +4. **Add reporting, diagnostics, dumps, or coverage flags.** + + | Goal | VSTest | MTP | + |---|---|---| + | TRX | `--logger trx` (`"trx;LogFileName=.trx"`; `vstest.console.exe`: `/Logger:trx`) | `--report-trx` | + | Results dir | `--results-directory ` | `--results-directory ` (after `--` in bridge mode) | + | Diagnostics | `--diag ` (`--verbosity diagnostic` writes no log) | `--diagnostic --diagnostic-output-directory ` | + | Crash dump | `--blame-crash` | `--crashdump` | + | Hang dump | `--blame-hang --blame-hang-timeout 5min` | `--hangdump --hangdump-timeout 5min` | + | Coverage | `--collect "Code Coverage"` | `--coverage` (for Cobertura add `--coverage-output-format cobertura`). Use `--coverage-output ` for a requested filename; sharing one path across projects or target frameworks can overwrite reports. | + + MTP flags require registered extensions (`TrxReport`, `CrashDump`, + `HangDump`, `CodeCoverage`); if unrecognized, inspect package references + before suggesting changes. + + ```shell + # VSTest mode with MTP bridge (Cobertura coverage) + dotnet test tests/App.Tests.csproj -- --coverage --coverage-output-format cobertura --results-directory TestResults/coverage + ``` + +5. **Report the outcome.** + + - **Advisory**: lead with the command in a fenced code block using established + paths, then one short syntax note naming `VSTest mode` or `native MTP mode` + when mode determines syntax. State the assumption when using a clear default + for a missing path or SDK/mode; ask without running if none exists. + - **Execution**: stop and report any missing path, SDK, or toolchain + prerequisite rather than running a speculative command. Otherwise report + the exact command run, observed counts with colons + (`Passed: N, Failed: N, Skipped: N`) when available (never invent counts), + and the first actionable failure. diff --git a/external-sources/upstreams/dotnet-skills/plugins/dotnet-test/skills/run-tests/SKILL.md b/external-sources/upstreams/dotnet-skills/plugins/dotnet-test/skills/run-tests/SKILL.md index f77df06..0cb915b 100644 --- a/external-sources/upstreams/dotnet-skills/plugins/dotnet-test/skills/run-tests/SKILL.md +++ b/external-sources/upstreams/dotnet-skills/plugins/dotnet-test/skills/run-tests/SKILL.md @@ -1,16 +1,14 @@ --- name: run-tests description: >- - ALWAYS USE before running .NET tests or answering with a test command or - flags. Trigger on "run the tests", "exact dotnet test command", one - test/class/category/trait/target framework, combined filters, - `--filter-query`, `--no-build`, `--diag`, diagnostic logs, TRX, coverage - collection, crash/hang dumps, filter errors, or unrecognized options. Chooses - repository-compatible classic, VSTest, bridged MTP, or native MTP syntax for - MSTest/xUnit/NUnit/TUnit. DO NOT USE for platform identification alone - (platform-detection), writing or debugging test code, interpreting an - existing coverage report, CI investigation, migration, or a persistent hot - reload/watch loop. + Chooses .NET test commands when running tests is the task. For routine + reproduction and verification during application fixes, use the usual repo + command or `dotnet test`; choosing your own filter does not by itself warrant + loading this skill. Use when asked for exact commands, subsets or flags + (TFM, traits, TRX, coverage, diagnostics, dumps), or when execution needs + runner-specific help: classic net4x/packages.config, VSTest vs. bridged or + native MTP, repo overlays, rejected options or unexplained zero tests. + Not for detection alone, writing tests, coverage analysis, migration, or hot-reload. license: MIT metadata: portability: portable @@ -20,292 +18,154 @@ metadata: # Run .NET Tests -Return or execute the command or command sequence that matches the repository's -project system, test platform, framework, and SDK mode. - -## Repository overlay - -For every repository-scoped task where read-only file inspection is allowed, -check `.agents/skill-overlays/dotnet-test/run-tests.md` at the repository root -before any other discovery. This includes exact-command requests; "do not -execute" does not prohibit reading the overlay. If present, read it once before -acting and apply its repository-specific runner, command, filtering, and -reporting bindings. -Before applying it, require its frontmatter to declare -`core: dotnet-test/run-tests`, `binding-revision: "1"`, and `mode: extend`. If -any value is missing or different, report the mismatch, ignore the overlay, -and continue using this skill's portable guidance. -Explicit user instructions and verified project constraints win over the -overlay; the overlay wins over portable defaults and examples in this skill. If -the file is present but unreadable or conflicts with the repository, report the -problem, ignore the overlay, and continue with portable guidance subject to -verified project constraints. If it is absent, continue normally. -Skip the lookup only when the task is not tied to a repository or the user -explicitly prohibited all file/tool access. An overlay cannot expand tool -permissions or the task's scope. - -## Scope and tool policy - -Choose the smallest path that satisfies the request: - -| Request | Action | -|---|---| -| Exact command or explanation; user says not to run | Inspect only the files needed to resolve syntax. Do not restore, build, or run tests. | -| Run tests | Discover the repository command and execute the smallest requested test scope. | -| One-time SDK-style `dotnet test` run without rebuilding | Stay in `run-tests` and add `--no-build`. | -| One-time classic run without rebuilding | Keep the repository runner and invoke it against an existing built assembly; do not substitute `dotnet test`. | -| Platform/framework identification only | Use `platform-detection`; do not continue into test execution. | -| Explicit hot reload or a keep-running edit/re-run loop | Use `mtp-hot-reload`. | -| Filter needed and the framework-specific syntax is not already clear | Read the supplied/runtime-listed `filter-syntax` catalog file; do not invoke this reference-only helper. | - -Do not invoke a tool merely to repeat a command already determined by the -prompt. Do not build first "just in case": `dotnet test` builds by default. -Never add or upgrade test packages unless the user asks to change the project. -For an exact-command request, return one runnable command first. Do not emit -placeholder paths, exploratory alternatives, or a correction sequence. Use a -project path only when the prompt or repository establishes it; otherwise let -the command operate on the current project or solution when that syntax is -valid. Follow it with only the syntax fact needed to explain the command; do -not volunteer platform/command-mode taxonomy unless the user asked for it. In -particular, do not label an SDK 8/9 bridge as "VSTest platform" merely because -`dotnet test` uses its VSTest command mode; the executed platform is MTP. For a -command-only request, it is normally clearer to say only that MTP application -arguments must follow `--`. - -## Inputs to discover - -- Project, solution, module, or repository test command -- Requested scope: all tests, TFM, class, method, category, or trait -- Requested output: console result, TRX, diagnostics, crash dump, or hang dump - -When those facts are present in the prompt, use them. Otherwise inspect only the -relevant files: `global.json`, the selected project, `packages.config`, -`Directory.Build.props`, `Directory.Packages.props`, then repository -scripts/CI documentation. For a file-backed request, enumerate those -configuration names once and read all relevant files that are present in one -batch; never infer that a runner or bridge property is absent merely because it -is not in the `.csproj`. Load `platform-detection` only when those signals need -precedence analysis; do not duplicate its full analysis in the response. -If execution is requested and the command depends on the active SDK but neither -the prompt nor `global.json` establishes it, run `dotnet --version` once. For a -command-only request that prohibits execution, do not probe: state the required -SDK assumption or ask for the SDK version when the syntax cannot otherwise be -resolved. Route identification-only requests to `platform-detection`. - -## Decision table - -| Detected mode / platform | Command shape | Never use | -|---|---|---| -| Classic non-SDK | Repository script, or full MSBuild followed by `vstest.console.exe` / `MSTest.exe` | Assuming `dotnet test` is compatible or migrating implicitly | -| VSTest mode / VSTest | `dotnet test [] [VSTEST_OPTIONS]` | MTP-only flags such as `--report-trx` or `--treenode-filter` | -| VSTest mode / executable MTP bridge | `dotnet test [] [DOTNET_OPTIONS] -- [MTP_OPTIONS]` | Omitting the `--` separator, including on SDK 10 | -| Native MTP mode, SDK 10+ | `dotnet test --project [DOTNET_OPTIONS] [MTP_OPTIONS]` | Bare positional project paths or the bridge separator | - -`global.json` controls the `dotnet test` command mode on SDK 10+, not -necessarily the platform that executes tests. A VSTest-mode project with an MTP -runner, `TestingPlatformDotnetTestSupport=true`, and final `OutputType=Exe` is -still bridge syntax with `--`. SDK 8/9 only has VSTest command mode. - -`--project` is valid only in SDK 10+ **native MTP command mode** (selected by -`global.json` `test.runner`). Never use it for VSTest mode or an SDK 8/9 bridge; -those forms take a positional project path. Conversely, native MTP options are -direct arguments and must not be placed after a bridge separator. - -Keep `dotnet test`/MSBuild options such as `--framework`, `--configuration`, -`--no-build`, and `--verbosity` before `--`. Put only MTP application arguments -after `--` in bridge mode. +Return or execute the narrowest test command matching the repository's project +system, test platform, framework, and SDK command mode. + +## Rules + +- **Advisory requests** (command without running): use only read-only file + tools (never invoke `bash`, `powershell`, or any shell — not even for `ls`, + `find`, `cat`, or a read-only `git` query), and never restore, build, or run tests. + Return a single runnable command (or an ordered restore/build/test sequence + for classic projects) for the detected or stated mode; never append + alternative commands for other platforms/modes or placeholder paths + (``, ``, `path/to/...`). If no test target path is + given or found and the current directory is a clear default, omit `--project` + and any test target path from `dotnet test` or `dotnet run` (see Step 5). +- **Execution requests**: run only the smallest requested scope. Do not run a + separate `dotnet build` before `dotnet test` unless passing `--no-build`. + Never add or upgrade test packages unless asked. +- **Verify execution**: a zero-test run does not verify the code, even at exit + 0. For a filtered run, confirm the reported names or counts match the scope. + Distinguish restore/build failures from test failures. +- **One-time no-rebuild runs**: add `--no-build` to the selected `dotnet test` + command (not `dotnet watch`), or before `--` in `dotnet run` for TUnit. For + classic projects, run the existing assembly or report the missing build. ## Workflow -1. **Resolve the repository-compatible runner.** - -For classic projects, signals include `ToolsVersion`, explicit `Compile` and -`Reference` items, legacy imports, and `packages.config`. Prefer a checked-in -script or documented CI command. A typical fallback is: - -```powershell -nuget restore MySolution.sln -MSBuild.exe MySolution.sln /t:Build /p:Configuration=Debug -vstest.console.exe path\to\MyTests.dll /TestAdapterPath:path\to\adapter\build\ -``` - -For `packages.config`, restore with NuGet before the build unless the imported -package files are already present. If adapter discovery is not repository- -configured, derive `/TestAdapterPath` from the restored adapter package path or -the adapter `.props`/`.targets` imports; do not guess the package root. - -For a requested no-rebuild run, omit the build step and invoke the repository's -test runner only when the expected assembly already exists. Otherwise report the -missing build output rather than silently rebuilding or switching runners. - -For a requested subset, keep the repository runner and use its filter syntax: -`vstest.console.exe path\to\MyTests.dll -/TestCaseFilter:"TestCategory=Integration"`. Older `MSTest.exe` repositories may -use `/test:` or `/category:` instead. Do not substitute the -later `dotnet test` filter examples for a classic runner. - -Use the installed adapter-compatible VSTest/MSTest toolchain. If it is not -available, state the missing prerequisite and the documented command; do not -claim tests ran. -Classic `packages.config` fallback commands are Windows toolchain commands. -Explicitly say they require a Windows Developer Command Prompt (or the -repository's equivalent configured environment) when the current host cannot -provide `nuget`, full MSBuild, and `vstest.console.exe`. - -For SDK-style projects, distinguish: - -| Signal | Meaning | -|---|---| -| SDK 10+ `global.json` selects `Microsoft.Testing.Platform` | Native MTP command mode | -| VSTest mode + enabled MTP runner + final `TestingPlatformDotnetTestSupport=true` + final `OutputType=Exe` | Executable VSTest-to-MTP bridge | -| VSTest mode without a complete runner-and-bridge combination | VSTest | -| `Microsoft.NET.Test.Sdk` plus adapter, without stronger MTP signals | VSTest | -| `TUnit` | MTP-only; use a configured bridge/native mode or the test executable | - -Evaluate properties from the project and imported -`Directory.Build.props`/`Directory.Packages.props`. Respect project-level -overrides and per-target-framework conditions. A runner and bridge without an -executable final output are an incomplete MTP configuration, not a usable -bridge. - -2. **Select the command and requested scope.** - -```shell -# VSTest mode -dotnet test path/to/Tests.csproj - -# VSTest mode that bridges to MTP -dotnet test path/to/Tests.csproj -- - -# Native MTP mode on SDK 10+ -dotnet test --project path/to/Tests.csproj - -# One target framework; this stays before the bridge separator -dotnet test path/to/Tests.csproj --framework net9.0 -- -``` - -For native MTP, use `--project`, `--solution`, or `--test-modules`; positional -paths belong to VSTest mode. - -If the user names a subset, do not run the whole suite. Inspect test attributes -only when needed to translate a human label such as "integration" or "smoke" -into the framework's actual category/trait name. - -When a VSTest class filter must distinguish similarly named classes, combine -the positive selector with an explicit negative selector rather than relying on -an incidental substring difference. - -3. **Apply platform- and framework-correct filters.** - -Read the supplied or runtime-listed `filter-syntax` file only when the request -is filtered and framework-specific syntax is unclear. It is reference-only, -not an invocable skill; otherwise use the common decisions below: - -For a file-backed filtered request, resolve the framework and SDK command mode -from the project, `global.json`, and imported props before choosing syntax. -Do not infer VSTest syntax merely from `Microsoft.NET.Test.Sdk` or from the -framework name. - -| Platform / framework | Filter | -|---|---| -| VSTest with MSTest, xUnit v2, or NUnit | `--filter ""` | -| MTP with MSTest or NUnit | Same expression; after `--` in bridge mode, direct in native mode | -| MTP with xUnit v3 | `--filter-class`, `--filter-method`, `--filter-trait`, or one `--filter-query` for a combined expression | -| MTP with TUnit | `--treenode-filter` path expression | - -Examples: - -```shell -# VSTest MSTest/NUnit -dotnet test --filter "FullyQualifiedName~OrderServiceTests&TestCategory=Unit" - -# SDK 8/9 or SDK 10 VSTest-mode MTP bridge, xUnit v3 -dotnet test -- --filter-trait "Category=Integration" - -# Native MTP, xUnit v3 -dotnet test --project Tests.csproj --filter-class "*ShoppingCartTests*" - -# One xUnit v3 combined expression -dotnet test -- --filter-query "/*/*/*Integration*/*[Category=Smoke]" - -# TUnit on SDK 8/9 with a configured VSTest-to-MTP bridge -dotnet test -- --treenode-filter "/*/*/SmsNotificationTests/*" - -# TUnit executable fallback when no bridge is configured -dotnet run --project Tests.csproj -- --treenode-filter "/*/*/SmsNotificationTests/*" -``` - -Do not use VSTest `--filter "ClassName=..."` with xUnit v3 on MTP. Do not use a -generic VSTest expression with TUnit. -When the user requests one combined xUnit query expression, return only one -`--filter-query` command; do not replace it with separate filter flags or offer -speculative alternative grammars. - -4. **Add reports or diagnostics.** - -| Outcome | VSTest | MTP | -|---|---|---| -| TRX | SDK-style: `--logger "trx;LogFileName=.trx"` when an exact output file is requested, otherwise `--logger trx`; standalone `vstest.console.exe`: `/Logger:trx`; `MSTest.exe`: repository-documented results option | `--report-trx` | -| Results directory | `--results-directory ` | `--results-directory ` | -| Diagnostic log | `--diag ` | `--diagnostic --diagnostic-output-directory ` | -| Crash dump | `--blame-crash` | `--crashdump` | -| Hang timeout | `--blame-hang --blame-hang-timeout 5min` | `--hangdump --hangdump-timeout 5min` | -| Code coverage | `--collect "Code Coverage"` | `--coverage` | - -MTP report, dump, and coverage flags require their corresponding registered -extensions (`TrxReport`, `CrashDump`, `HangDump`, or `CodeCoverage`). Some -framework SDKs bundle common extensions; if a flag is unrecognized, inspect -package references before recommending a package change. - -`--verbosity diagnostic` increases dotnet/MSBuild output verbosity; it does not -write a VSTest diagnostic log file. - -Examples: - -```shell -# VSTest TRX -dotnet test Tests.csproj --logger "trx;LogFileName=TestResults.trx" - -# MTP bridge TRX -dotnet test Tests.csproj -- --report-trx - -# Native MTP TRX and hang detection -dotnet test --project Tests.csproj --report-trx --hangdump --hangdump-timeout 5min - -# Native MTP diagnostics -dotnet test --project Tests.csproj --diagnostic --diagnostic-output-directory artifacts/diagnostics -``` - -5. **Execute only when requested.** - -Run the narrowest command or sequence that answers the request. Capture each -command, exit code, and test summary. A failed restore/build is not a test -failure, and a test failure is not a tool failure. Report which phase failed and -include the actionable diagnostic. Never claim a clean run unless the sequence -completed successfully with the intended tests executed. -For a filtered run, a successful exit is not enough: confirm the reported test -names or count match the requested scope. If the filter was ignored, correct the -platform-specific syntax and rerun before reporting success. - -## Output contract - -- Command-only request: lead with the exact command or command sequence, then - one short syntax explanation. -- Execution request: report the exact command or command sequence and - a literal `Passed: N, Failed: N, Skipped: N` summary from the completed run; - include the first actionable failure. -- Detection needed only to choose syntax: state the selected mode/platform - briefly, not a separate detection report. -- Missing prerequisite or incompatible configuration: name it explicitly and - stop rather than returning a success-shaped fallback. - -## Validation - -- The command matches classic, VSTest, bridged MTP, or native MTP mode. -- The framework-specific filter targets the requested subset. -- `--framework` and other `dotnet test` options are before any bridge separator. -- SDK 8/9 bridge commands contain `--`; `--project` appears only in SDK 10+ - native MTP mode. -- TRX, diagnostics, dump, and coverage flags match the platform. -- No restore, build, or test was run for an advisory-only request. -- Reported results match the actual command outcome. +1. **Inspect the workspace.** + + Before answering, inspect the **current working directory (not the skill + directory)**. Skip inspection when the user forbids file reads or asks for + an answer from supplied content only, and honor those limits in later steps + too. "Do not run the tests" alone still permits read-only inspection. Also + skip inspection for advisory requests that explicitly + state the test platform, applicable SDK command mode, and framework and do + not refer to the current project or repository. + + In one parallel batch using file-search/read tools (such as `glob`, `grep`, + and `view` — not a shell), check the current working directory for project + files, `packages.config`, `global.json`, `Directory.Build.props`, + `Directory.Build.targets`, and `Directory.Packages.props`, plus the direct + overlay read below. If host/session context or the prompt establishes an + ancestor repository root above the current working directory, keep project + discovery scoped to the working directory and include in the same batch + applicable ancestor `global.json`, `Directory.Build.*`, and + `Directory.Packages.props` up to that root. Otherwise, treat the current + working directory as the root and do not probe parent directories; if the + working directory is a filesystem root (such as `/`), skip directory + discovery and inspect only paths named by the user. Never guess VSTest when + project files exist in the workspace. If that batch finds no project files + for an advisory request, do not retry project discovery; still apply any + valid overlay or repo script/CI check if applicable, otherwise answer from + the prompt. Resolve properties in MSBuild import order with per-TFM + conditions; a property absent from `.csproj` may come from an import. + Consult `platform-detection` internally when available only if precedence, + defaults, or conflicts remain unclear (do not duplicate its analysis). For + repo entry-point requests, if initial reads and any valid overlay do not + define one, check repo scripts/CI docs (`eng/`, `build.*`, + `.github/workflows/`) under the resolved repository root (skipping if at a + filesystem root); if none define one, return the resolved portable command + and label it portable. Run `dotnet --version` only when executing and + neither prompt nor `global.json` sets the SDK. + + **Optional repository overlay:** Whenever workspace inspection is not + skipped by the rule above (and the resolved root is not a filesystem root), + always read `.agents/skill-overlays/dotnet-test/run-tests.md` at the + resolved repository root directly with a file-read tool — even if you + already listed the directory, because directory listings omit hidden + `.agents/` folders. If present, require YAML frontmatter + `core: dotnet-test/run-tests`, `binding-revision: "1"`, and `mode: extend`. + When valid and repo-consistent, apply its bindings + (precedence: user > verified repo constraints > overlay > portable defaults; + overlays cannot expand permissions, scope, filesystem/network access, or + publication authority). If the overlay is unreadable, has a missing or + mismatched required field, or conflicts with the repo, report the specific + problem (explicitly call an unsupported revision a `binding-revision` + mismatch), ignore the overlay, and continue with portable guidance. + +2. **Match command shape to project system and SDK mode.** + + | Mode / platform | Signals | Command shape | Never use | + |---|---|---|---| + | Classic non-SDK | `ToolsVersion`, explicit `Compile`/`Reference`, `packages.config` | Repo script, or `nuget restore` + `MSBuild.exe` + `vstest.console.exe` (`/TestCaseFilter:`, `/TestAdapterPath:`, `/Logger:trx`); `MSTest.exe` (`/test:`, `/category:`) only if repo-established | `dotnet test` or implicit migration | + | VSTest mode (VSTest) | VSTest mode + VSTest-capable SDK-style project with `UseVSTest=true` or no enabled MTP runner/bridge pair | `dotnet test [] [VSTEST_OPTIONS]` (plus `-- ` only for inline RunSettings, e.g. `dotnet test -- MSTest.MapInconclusiveToFailed=true`) | `--project`, `--` for non-RunSettings options, or MTP flags (even after `--`) | + | VSTest mode (bridged MTP) | SDK 8/9, or SDK 10+ with MTP 1.x and VSTest command mode (selected in `global.json` or used by default); enabled MTP runner, `TestingPlatformDotnetTestSupport=true`, `OutputType=Exe`, no `UseVSTest=true` | `dotnet test [] [DOTNET_OPTIONS] -- [MTP_OPTIONS]` | `--project` or MTP flags without `--` | + | Native MTP (SDK 10+) | SDK 10+ `global.json` `"test": { "runner": "Microsoft.Testing.Platform" }` (never from `TargetFramework=net10.0` alone) + `Exe` MTP app (no `UseVSTest=true`) | `dotnet test [--project ] [DOTNET_OPTIONS] [MTP_OPTIONS]` (or `--solution`/`--test-modules`) | Bare positional path, `--`, or VSTest-only flags | + | TUnit without bridge/native | `TUnit` (MTP-only) without `global.json` native MTP or `TestingPlatformDotnetTestSupport=true` (even on `net10.0`) | `dotnet run [--project ] -- [MTP_OPTIONS]` (include `--project ` whenever a target project path is given or found in the workspace; omit it only when none is given or found and the current directory is a clear default) | `dotnet test` | + + - In **VSTest mode (bridged MTP)**, put `dotnet test`/MSBuild options + (`--framework `, `--configuration`, `--no-build`, `--verbosity`) + **before** `--`, and MTP options (including `--results-directory`) + **after** `--`. + - On SDK 10+, MTP 2.x rejects the VSTest bridge; report the incompatibility + instead of giving a bridged command. In native MTP mode, report incompatible + projects or `UseVSTest=true` rather than falling back to VSTest. Runner + + bridge without `OutputType=Exe` is incomplete. + - For classic `packages.config`, derive `/TestAdapterPath:` from restored + packages or `.props`/`.targets` imports and note the Windows Developer + Command Prompt requirement when unavailable. + +3. **Apply framework-specific filters.** + + Read the supplied or runtime-listed `filter-syntax` reference (never invoke + as a skill) only when complex filter grammar is still unclear. + + | Platform / framework | Filter syntax | + |---|---| + | VSTest (MSTest, xUnit, NUnit) | `--filter ""` (`=`, `!=`, `~`, `!~`, `&`, `\|`). MSTest/NUnit: `TestCategory`, `FullyQualifiedName` (MSTest: `ClassName`); xUnit: trait name (e.g. `Category`), `FullyQualifiedName`. Quote `&`/`\|`. Combine positive + negative selectors for similar class names. | + | MTP + MSTest / NUnit | Same `--filter ""` (`TestCategory=...`), after `--` in bridge mode or direct in native mode. Never `--filter-class` for NUnit. | + | MTP + xUnit v3 | `--filter-class`, `--filter-method`, `--filter-trait "Key=Value"`, or one `--filter-query "////[Trait=Val]"` for a single combined expression. Never VSTest `--filter`. | + | MTP + TUnit | `--treenode-filter "////[Prop=Val]"` (`/*/*/*/*[Category!=Slow]` across suite; `/*/*/ClassName/*` for a class). Never VSTest `--filter`. | + + ```shell + dotnet test --filter "FullyQualifiedName~OrderServiceTests&TestCategory=Unit" # VSTest MSTest/NUnit + dotnet test -- --filter-trait "Category=Integration" # Bridged MTP xUnit v3 + dotnet test -- --filter-query "/*/*/*Integration*/*[Category=Smoke]" # Bridged MTP xUnit v3 query + dotnet test --project Tests.csproj --filter-class "*ShoppingCartTests*" # Native MTP xUnit v3 + dotnet run -- --treenode-filter "/*/*/*/*[Category!=Slow]" # TUnit fallback (no bridge/native) + dotnet run --project TestProject.csproj -- --treenode-filter "/*/*/SmsNotificationTests/*" + ``` + +4. **Add reporting, diagnostics, dumps, or coverage flags.** + + | Goal | VSTest | MTP | + |---|---|---| + | TRX | `--logger trx` (`"trx;LogFileName=.trx"`; `vstest.console.exe`: `/Logger:trx`) | `--report-trx` | + | Results dir | `--results-directory ` | `--results-directory ` (after `--` in bridge mode) | + | Diagnostics | `--diag ` (`--verbosity diagnostic` writes no log) | `--diagnostic --diagnostic-output-directory ` | + | Crash dump | `--blame-crash` | `--crashdump` | + | Hang dump | `--blame-hang --blame-hang-timeout 5min` | `--hangdump --hangdump-timeout 5min` | + | Coverage | `--collect "Code Coverage"` | `--coverage` (for Cobertura add `--coverage-output-format cobertura`). Use `--coverage-output ` for a requested filename; sharing one path across projects or target frameworks can overwrite reports. | + + MTP flags require registered extensions (`TrxReport`, `CrashDump`, + `HangDump`, `CodeCoverage`); if unrecognized, inspect package references + before suggesting changes. + + ```shell + # VSTest mode with MTP bridge (Cobertura coverage) + dotnet test tests/App.Tests.csproj -- --coverage --coverage-output-format cobertura --results-directory TestResults/coverage + ``` + +5. **Report the outcome.** + + - **Advisory**: lead with the command in a fenced code block using established + paths, then one short syntax note naming `VSTest mode` or `native MTP mode` + when mode determines syntax. State the assumption when using a clear default + for a missing path or SDK/mode; ask without running if none exists. + - **Execution**: stop and report any missing path, SDK, or toolchain + prerequisite rather than running a speculative command. Otherwise report + the exact command run, observed counts with colons + (`Passed: N, Failed: N, Skipped: N`) when available (never invent counts), + and the first actionable failure. diff --git a/external-sources/vendir.lock.yml b/external-sources/vendir.lock.yml index 9228257..32ec354 100644 --- a/external-sources/vendir.lock.yml +++ b/external-sources/vendir.lock.yml @@ -6,21 +6,22 @@ directories: sha: d8719df176eb1c0c283d0c2cd8eb3f121fba9735 path: blazingfastdotnet - git: - commitTitle: 'Merge pull request #1375 from dotnet/bot/weekly-version-sync...' - sha: 399a0f3a87aef59b5ded28454fc600dfbdb533c9 + commitTitle: Simplify dotnet-test/run-tests trigger and body to reduce routine-coding + overhead (#1420) + sha: 1f140e794226d096eef7096b87bb28b4269da9a1 tags: - - skill-validator-nightly-4-g399a0f3a + - skill-validator-nightly-1-g1f140e79 path: dotnet-skills - git: commitTitle: Add Cursor rules that reference the existing skill docs... sha: af2319bd01bb7cc881267a9ef42cafdaf5e9029d path: webgpu-claude-skill - git: - commitTitle: 'fix(node): do not echo `//` or backslash paths into `Location` - with `trailingSlash: ''never''` (#18921)...' - sha: 2cb2de91e69bf2906c711794c6834ccf40292ac6 + commitTitle: 'fix: match uppercase X-Forwarded-Proto against allowedDomains + entries with a port (#18939)' + sha: f11a768bf790aff1ea099b579b4321631e7827dd tags: - - '@astrojs/cloudflare@14.4.10-23-g2cb2de91e6' + - '@astrojs/cloudflare@14.4.10-24-gf11a768bf7' path: astro - git: commitTitle: AI specs