Nota
L-aċċess għal din il-paġna jeħtieġ l-awtorizzazzjoni. Tista’ tipprova tidħol jew tibdel id-direttorji.
L-aċċess għal din il-paġna jeħtieġ l-awtorizzazzjoni. Tista’ tipprova tibdel id-direttorji.
MTP ships with built-in features and can be extended through NuGet packages.
When using Microsoft.Testing.Platform.MSBuild (included transitively by MSTest, NUnit, and xUnit runners), installing an extension NuGet package is all you need — extensions are automatically detected and registered, and the entry point is generated for you.
If you opt out of the auto-generated entry point by setting <GenerateTestingPlatformEntryPoint>false</GenerateTestingPlatformEntryPoint>, you must register extensions manually in your Main method. Each extension page documents the manual registration call.
Extensions that require a NuGet package are shipped with their own licensing model (some less permissive), be sure to refer to the license associated with the extensions you want to use.
Some extensions are experimental: their APIs are annotated with the TPEXP diagnostic and might change in a future release, so you must acknowledge the diagnostic to use them. Experimental extensions are marked (experimental) in the following lists.
Start here
Use the following path based on your goal:
- Find command-line switches in one place: MTP CLI options reference.
- Add capabilities to your test runs: use the feature pages in this article.
- Create your own extension: MTP architecture, Extension points, and Services.
Choose by scenario
- Need to customize terminal output: Terminal output (built-in)
- Need TRX or Azure DevOps reports: Test reports (extension)
- Need GitHub Actions-native output (log groups, annotations, and job summary): GitHub Actions report (extension, experimental)
- Need coverage data: Code coverage (extension)
- Need crash or hang diagnostics: Crash and hang dumps (extension)
- Need to retry failed tests: Retry (extension)
- Need hot reload support: Hot Reload (extension)
- Need Microsoft Fakes support: Microsoft Fakes (extension)
- Need OpenTelemetry traces and metrics: OpenTelemetry (extension)
- Telemetry data collection and opt-out: Telemetry (extension)
Built-in features
These features are part of the core platform and don't require additional NuGet packages.
Status and progress reporting to the terminal: output modes, ANSI support, and progress indicators.
Extension features
These features require installing NuGet packages.
Generate test report files (TRX, Azure DevOps).
GitHub Actions report (experimental, introduced in MTP 2.3.0)
Emit GitHub Actions-native workflow commands so test runs produce a first-class experience: per-assembly log groups, failure annotations (surfaced in the workflow Annotations tab and, when the source location resolves, on the pull request's Files changed diff), a Markdown job summary appended to GITHUB_STEP_SUMMARY, and slow-test notices. The extension activates automatically when the GITHUB_ACTIONS environment variable is true, or elsewhere with the --report-gh switch. Each feature can be turned on or off individually with the --report-gh-groups, --report-gh-annotations, --report-gh-step-summary, and --report-gh-slow-test-notices options, and the slow-test threshold is set with --report-gh-slow-test-threshold. Register it manually with builder.AddGitHubActionsProvider().
Collect code coverage data during test execution.
Collect process dump files when the test host crashes or hangs.
Emit traces and metrics through OpenTelemetry during test runs.
Retry failed tests with configurable policies.
Run tests with hot reload support for rapid iteration.
Run tests that use Microsoft Fakes for stubs and shims.
Telemetry collection. Learn how to opt out and what data is collected.
Video recorder (experimental, introduced in MTP 2.3.0)
Record the screen during a test run. It requires ffmpeg to be available on the machine and is enabled with the --capture-video option. Register it manually with builder.AddVideoRecorderProvider().
Packaged app deployment (experimental, introduced in MTP 2.3.0)
A reference extension that uses the experimental ITestHostLauncher extension point to deploy and launch a packaged-app test host. Register it manually with builder.AddPackagedAppDeployment().
Microsoft.Extensions integration
These extensions bridge Microsoft.Testing.Platform to the Microsoft.Extensions.* libraries your application already uses.
Logging bridge (experimental, introduced in MTP 2.3.0)
The Microsoft.Testing.Extensions.Logging package bridges Microsoft.Testing.Platform diagnostics to ILogger, so platform and extension logs flow through the same Microsoft.Extensions.Logging pipeline your application already uses. Register it manually with the following call:
var builder = await TestApplication.CreateBuilderAsync(args);
builder.AddMicrosoftExtensionsLogging(logging => logging.AddConsole());