Skip to content

Commit 253e294

Browse files
Update reporting formatting (#15082)
* Update reporting formatting Improve formatting of the test reporter documentation. * More formatting Improve more formatting. * Apply suggestions from code review
1 parent 107abd3 commit 253e294

File tree

1 file changed

+61
-37
lines changed

1 file changed

+61
-37
lines changed

docs/report.md

Lines changed: 61 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if you're interested in the architecture of a test logger.
1919

2020
### Available test loggers
2121

22-
| Scenario | Nuget Package | Source Repository |
22+
| Scenario | NuGet Package | Source Repository |
2323
| -------- | ------------- | ----------------- |
2424
| Local, CI, CD | Inbuilt | [Trx Logger][] |
2525
| Local, CI, CD | Inbuilt | [Console Logger][] |
@@ -30,7 +30,7 @@ if you're interested in the architecture of a test logger.
3030
| AppVeyor | [AppVeyor.TestLogger][appveyor.nuget] | [AppVeyor Logger][] |
3131
| Azure Pipelines | [AzurePipelines.TestLogger][azurepipelines.nuget] | [Azure Pipelines Logger][] |
3232
| GitHub Actions | [GitHubActionsTestLogger][githubactions.nuget] | [GitHub Actions Test Logger][] |
33-
| TeamCity | [TeamCity.VSTest.TestAdapter][teamcity.nuget] | [Teamcity Logger][] |
33+
| TeamCity | [TeamCity.VSTest.TestAdapter][teamcity.nuget] | [TeamCity Logger][] |
3434

3535
[Trx Logger]: https://github.com/Microsoft/vstest/tree/main/src/Microsoft.TestPlatform.Extensions.TrxLogger
3636
[Html Logger]: https://github.com/Microsoft/vstest/tree/main/src/Microsoft.TestPlatform.Extensions.HtmlLogger
@@ -71,25 +71,27 @@ to one of the following locations:
7171
dotnet-cli, the path could be `/sdk/<version>/Extensions` directory.
7272
2. any well known location on the filesystem
7373

74-
> Version Note: new in 15.1
75-
In case of #2, user can specify the full path to the location using `/TestAdapterPath:<path>`
76-
command line switch. Test platform will locate extensions from the provided
77-
directory.
74+
> [!NOTE]
75+
> **New in 15.1**
76+
>
77+
> In case of #2, user can specify the full path to the location using `/TestAdapterPath:<path>`
78+
> command line switch. Test platform will locate extensions from the provided
79+
> directory.
7880
7981
## Naming
8082

8183
Test platform will look for assemblies named `*.testlogger.dll` when it's trying
8284
to load test loggers.
8385

84-
> Version Note: < 15.1
85-
> For 15.0 version, the test loggers are also discovered from *.testadapter.dll
86+
> [!NOTE]
87+
> For the 15.0 version, the test loggers are also discovered from `*.testadapter.dll`
8688
8789
## Create a test logger
8890

8991
Go through the following steps to create your own logger
9092

9193
1) Add a nuget reference of package `Microsoft.TestPlatform.ObjectModel`.
92-
2) Implement ITestLoggerWithParameters (or ITestLogger, if your logger is not expecting any parameter). [Logger Example](https://github.com/spekt/xunit.testlogger/blob/master/src/Xunit.Xml.TestLogger/XunitXmlTestLogger.cs#L19)
94+
2) Implement `ITestLoggerWithParameters` (or `ITestLogger`, if your logger is not expecting any parameters). [Logger Example](https://github.com/spekt/xunit.testlogger/blob/49d2416f24acb30225adc6e65753cc829010bec9/src/Xunit.Xml.TestLogger/XunitXmlTestLogger.cs#L19)
9395
3) Name your logger assembly `*.testlogger.dll`. [Detailed](./report.md#naming)
9496

9597
## Enable a test logger
@@ -100,7 +102,7 @@ A test logger must be explicitly enabled using the command line. E.g.
100102
vstest.console test_project.dll /logger:mylogger
101103
```
102104

103-
Where `mylogger` is the LoggerUri or FriendlyName of the logger.
105+
Where `mylogger` is the `LoggerUri` or `FriendlyName` of the logger.
104106

105107
## Configure reporting
106108

@@ -110,40 +112,48 @@ Additional arguments to a logger can also be passed in the command line. E.g.
110112
vstest.console test_project.dll /logger:mylogger;Setting=Value
111113
```
112114

113-
Where `mylogger` is the LoggerUri or FriendlyName of the logger.
114-
`Setting` is the name of the additional argument and `Value`is its value.
115+
Where `mylogger` is the `LoggerUri` or `FriendlyName` of the logger.
116+
`Setting` is the name of the additional argument and `Value` is its value.
115117

116-
It is upto the logger implementation to support additional arguments.
118+
It is up to the logger implementation to support additional arguments.
117119

118120
## Syntax of default loggers
119121

120122
### 1) Console logger
121123

122-
Console logger is the default logger and it is used to output the test results into console window.
124+
Console logger is the default logger and it is used to output the test results to a terminal.
123125

124126
#### Syntax
125127

128+
For dotnet test or dotnet vstest:
129+
126130
```shell
127-
For dotnet test or dotnet vstest :
128131
--logger:console[;verbosity=<Defaults to "minimal">]
132+
```
129133

130-
For vstest.console.exe :
134+
For vstest.console.exe:
135+
136+
```shell
131137
/logger:console[;verbosity=<Defaults to "normal">]
132-
133-
Argument "verbosity" define the verbosity level of console logger. Allowed values for verbosity are "quiet", "minimal", "normal" and "detailed".
134138
```
139+
140+
Argument `verbosity` defines the verbosity level of the console logger. Allowed values for verbosity are `quiet`, `minimal`, `normal` and `detailed`.
135141

136142
#### Example
137143

138144
```shell
139145
vstest.console.exe Tests.dll /logger:"console;verbosity=normal"
146+
```
140147

141-
If you are using "dotnet test", then use the following command
148+
If you are using `dotnet test`, then use the following command:
142149

150+
```shell
143151
dotnet test Tests.csproj --logger:"console;verbosity=normal"
152+
```
144153

145-
or you can also use argument "-v | --verbosity" of "dotnet test"
154+
or you can also use argument `-v | --verbosity` of `dotnet test`:
146155

156+
```shell
147157
dotnet test Tests.csproj -v normal
148158
```
149159

@@ -155,28 +165,35 @@ Trx logger is used to log test results into a Visual Studio Test Results File (T
155165

156166
```shell
157167
/logger:trx [;LogFileName=<Defaults to unique file name>]
158-
159-
Where "LogFileName" can be absolute or relative path. If path is relative, it will be relative to "TestResults" directory, created under current working directory.
160168
```
161169

170+
Where `LogFileName` can be absolute or relative path. If the path is relative, it will be relative to the `TestResults` directory, created under current working directory.
171+
172+
162173
#### Examples
163174

164-
Suppose the current working directory is "c:\tempDirecory".
175+
Suppose the current working directory is `c:\tempDirectory`.
165176

166177
```shell
167-
1) vstest.console.exe Tests.dll /logger:trx
168-
trx file will get generated in location "c:\tempDirecory\TestResults"
178+
vstest.console.exe Tests.dll /logger:trx
179+
```
180+
181+
trx file will get generated in location `c:\tempDirectory\TestResults`.
182+
183+
```shell
184+
vstest.console.exe Tests.dll /logger:"trx;LogFileName=relativeDir\logFile.txt"
169185

170-
2) vstest.console.exe Tests.dll /logger:"trx;LogFileName=relativeDir\logFile.txt"
171-
trx file will be "c:\tempDirecory\TestResults\relativeDir\logFile.txt"
186+
trx file will be `c:\tempDirectory\TestResults\relativeDir\logFile.txt`.
172187

173-
3) vstest.console.exe Tests.dll /logger:"trx;LogFileName=c:\temp\logFile.txt"
174-
trx file will be "c:\temp\logFile.txt"
188+
```shell
189+
vstest.console.exe Tests.dll /logger:"trx;LogFileName=c:\temp\logFile.txt"
175190
```
176191

192+
trx file will be `c:\temp\logFile.txt`.
193+
177194
### 3) Html logger
178195

179-
Html logger is used to log test results into a html file.
196+
Html logger is used to log test results into a HTML file.
180197

181198
#### Syntax
182199

@@ -189,19 +206,26 @@ Where "LogFileName" can be absolute or relative path. If path is relative, it wi
189206

190207
#### Examples
191208

192-
Suppose the current working directory is "c:\tempDirecory".
209+
Suppose the current working directory is `c:\tempDirectory`.
193210

194211
```shell
195-
1) vstest.console.exe Tests.dll /logger:html
196-
Html file will get generated in location "c:\tempDirecory\TestResults"
212+
vstest.console.exe Tests.dll /logger:html
213+
```
197214

198-
2) vstest.console.exe Tests.dll /logger:"html;LogFileName=relativeDir\logFile.html"
199-
Html file will be "c:\tempDirecory\TestResults\relativeDir\logFile.html"
215+
HTML file will get generated in location `c:\tempDirectory\TestResults`.
200216

201-
3) vstest.console.exe Tests.dll /logger:"html;LogFileName=c:\temp\logFile.html"
202-
Html file will be "c:\temp\logFile.html"
217+
```shell
218+
vstest.console.exe Tests.dll /logger:"html;LogFileName=relativeDir\logFile.html"
219+
```
220+
221+
HTML file will be `c:\tempDirectory\TestResults\relativeDir\logFile.html`.
222+
223+
```shell
224+
vstest.console.exe Tests.dll /logger:"html;LogFileName=c:\temp\logFile.html"
203225
```
204226

227+
HTML file will be `c:\temp\logFile.html`.
228+
205229
## Related links
206230

207231
TODO: link to author a test logger

0 commit comments

Comments
 (0)