run-tests

Detects the .NET test platform and runs dotnet test with correct filter syntax.

1|Updated Jun 1, 2026
One-click install
npx skills add https://github.com/D1ssolve/craft-agents --skill run-tests-d1ssolve
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: run-tests
Source: https://github.com/D1ssolve/craft-agents/tree/main/skills/run-tests
Command: npx skills add https://github.com/D1ssolve/craft-agents --skill run-tests-d1ssolve

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Running .NET tests is error-prone because VSTest and Microsoft.Testing.Platform (MTP) use incompatible command-line flags, and the correct syntax changes across .NET SDK 8, 9, and 10+. This Skill detects the test platform and framework from project files, then constructs the correct dotnet test invocation so you avoid argument mixups like --logger trx versus --report-trx. ## Core Features & Use Cases - Platform Detection: Reads global.json, .csproj, Directory.Build.props, and Directory.Packages.props to determine whether a project uses VSTest or MTP and which SDK version applies. - Correct Command Construction: Applies the right syntax for each combination, including the -- separator rules on SDK 8/9 versus direct MTP arguments on SDK 10+. - Framework-Aware Filtering: Translates test categories into the proper filter syntax for MSTest, xUnit v2/v3, NUnit, and TUnit (--filter, --filter-class, --filter-trait, --treenode-filter). - Use Case: You ask to run only the integration tests in a multi-TFM xUnit v3 project on .NET 10. The Skill detects MTP from global.json, then runs dotnet test --project <path> --framework net9.0 --filter-trait "Category=Integration" instead of the whole suite. ## Quick Start Run only the integration tests in my .NET project using the correct dotnet test command for my setup.

Frequently Asked Questions about run-tests

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run filtered tests with dotnet test?

Use `dotnet test --filter "<expression>"` for VSTest projects with operators like `=`, `!=`, and `~`. On Microsoft.Testing.Platform, MSTest and NUnit keep the same `--filter` syntax, while xUnit v3 uses `--filter-class`, `--filter-method`, and `--filter-trait`, and TUnit uses `--treenode-filter`.

How do I know if my .NET project uses VSTest or Microsoft.Testing.Platform?

Check `global.json` for `"test": { "runner": "Microsoft.Testing.Platform" }` on .NET SDK 10+, or look for `<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>` in `.csproj` or `Directory.Build.props` on SDK 8/9. If neither signal is present, the project uses VSTest.

What is the difference between --logger trx and --report-trx?

`--logger trx` is the VSTest flag for generating TRX result files, while `--report-trx` is the Microsoft.Testing.Platform equivalent and requires the Microsoft.Testing.Extensions.TrxReport package. Using the wrong flag for your platform causes an unrecognized option error.

Does dotnet test need the -- separator on .NET 10?

No. On .NET SDK 10+, MTP arguments are passed directly, for example `dotnet test --project . --report-trx`. The `--` separator is only required on .NET SDK 8 and 9 when bridging to Microsoft.Testing.Platform.

Why does dotnet test report no test matches the given filter?

This usually means the filter syntax does not match the platform or framework, such as using VSTest expression syntax with xUnit v3 on MTP. Verify the correct filter flags for your framework and confirm property names like `TestCategory` for MSTest versus `Category` traits for xUnit.

How do I run tests for only one target framework in a multi-TFM project?

Pass `--framework <TFM>` to `dotnet test`, for example `dotnet test --framework net8.0`, when the project uses `<TargetFrameworks>` with multiple monikers. This flag is consumed by dotnet test itself and always goes before the `--` separator on SDK 8/9.