|
1 | 1 | --- |
2 | 2 | title: Microsoft.Testing.Platform (MTP) test reports |
3 | | -description: Learn about the MTP extensions that create test report files (TRX, HTML, JUnit, CTRF, Azure DevOps). |
| 3 | +description: Learn about the MTP extensions that create test report files (TRX, HTML, JUnit, CTRF, Azure DevOps, GitHub Actions). |
4 | 4 | author: evangelink |
5 | 5 | ms.author: amauryleve |
6 | 6 | ms.date: 06/16/2026 |
@@ -163,3 +163,30 @@ builder.TestHost.AddAzureDevOpsProvider(); |
163 | 163 | > The **MTP version** column lists the MTP release in which each option first became available in a stable build. The Azure DevOps extension itself became stable in MTP 1.9.0 with `--report-azdo` and `--report-azdo-severity`; the remaining options were added in MTP 2.3.0. |
164 | 164 |
|
165 | 165 | The extension automatically detects that it is running in continuous integration (CI) environment by checking the `TF_BUILD` environment variable. |
| 166 | + |
| 167 | +## GitHub Actions reports |
| 168 | + |
| 169 | +The GitHub Actions report emits GitHub Actions-native workflow commands so test runs produce a first-class experience on the runner: per-assembly log groups, failed and skipped test 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 the file referenced by `GITHUB_STEP_SUMMARY`, and slow-test notices. |
| 170 | + |
| 171 | +The extension activates only when the run is on GitHub Actions (the `GITHUB_ACTIONS` environment variable is `true`) and the `--report-gh` switch is set; otherwise it does nothing. When active, each feature is enabled by default and can be turned off individually with its `--report-gh-*` option. |
| 172 | + |
| 173 | +> [!NOTE] |
| 174 | +> Available in MTP starting with version 2.3.0. This extension is experimental, and its options and output format might change in a future version. |
| 175 | +
|
| 176 | +### Manual registration |
| 177 | + |
| 178 | +```csharp |
| 179 | +var builder = await TestApplication.CreateBuilderAsync(args); |
| 180 | +builder.AddGitHubActionsProvider(); |
| 181 | +``` |
| 182 | + |
| 183 | +### Options |
| 184 | + |
| 185 | +| Option | MTP version | Description | |
| 186 | +|---|---|---| |
| 187 | +| `--report-gh` | 2.3.0 | Enables the GitHub Actions report generator so test runs emit workflow commands. Requires the run to be on GitHub Actions. | |
| 188 | +| `--report-gh-groups` | 2.3.0 | Enables or disables per-assembly log groups. Valid values are `on` (default) and `off`. Requires `--report-gh`. | |
| 189 | +| `--report-gh-annotations` | 2.3.0 | Enables or disables annotations for failed and skipped tests. Valid values are `on` (default) and `off`. Requires `--report-gh`. | |
| 190 | +| `--report-gh-step-summary` | 2.3.0 | Enables or disables writing a Markdown job summary to the file referenced by `GITHUB_STEP_SUMMARY`. Valid values are `on` (default) and `off`. Requires `--report-gh`. | |
| 191 | +| `--report-gh-slow-test-notices` | 2.3.0 | Enables or disables slow-test notices. Valid values are `on` (default) and `off`. Requires `--report-gh`. | |
| 192 | +| `--report-gh-slow-test-threshold` | 2.3.0 | The duration a test can run before a slow-test notice is emitted. Accepts a bare number of seconds or a value with a unit suffix such as `90s`, `2m`, or `1.5h`. The default is `60s`. Requires `--report-gh`. | |
0 commit comments