You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+52-4Lines changed: 52 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,63 @@
1
1
# AzurePipelines.TestLogger
2
+
2
3
Azure Pipelines logger extension for the [Visual Studio Test Platform](https://gtihub.com/microsoft/vstest).
3
4
5
+
## Why Do I Need This?
6
+
7
+
This logger extensions allows you to send test results from a `dotnet test` session directly to Azure Pipelines in real-time as the tests are executed. It also talks directly to the Azure DevOps REST API and as a result can better represent your tests using Azure Pipelines conventions over other post-processing methods such as logging to a TRX file and processing with the `PublishTestResults` Azure Pipelines task.
8
+
4
9
## Usage
5
-
AzurePipelines.TestLogger can report test results automatically to the CI build.
6
10
7
-
1. Add a reference to the [AzurePipelines.TestLogger NuGet package](https://www.nuget.org/packages/AzurePipelines.TestLogger) in your test project
8
-
2. Use the following command when running tests
11
+
In order for the logger to authenticate against the Azure DevOps API you'll need to [expose the access token via an environment variable](https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=vsts&tabs=yaml%2Cbatch#systemaccesstoken) in your Azure Pipelines `.yml` file:
12
+
13
+
```
14
+
env:
15
+
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
16
+
```
17
+
18
+
### Installing Into Your Project
19
+
20
+
* Add a reference to the [AzurePipelines.TestLogger NuGet package](https://www.nuget.org/packages/AzurePipelines.TestLogger) in your test project
21
+
* Use the following command when running tests
9
22
```
10
23
> dotnet test --test-adapter-path:. --logger:AzurePipelines
11
24
```
12
-
3. Test results are automatically reported to the Azure Pipelines CI results
25
+
* Test results are automatically reported to the Azure Pipelines CI results
26
+
27
+
### Using Cake
28
+
29
+
An alternative to installing the logger directly into your test project is installing it as a tool in Cake:
30
+
31
+
```
32
+
#tool "AzurePipelines.TestLogger&version=1.0.0"
33
+
```
34
+
35
+
Then you can specify the logger during test runs when running on your CI server (the following is example code, your Cake build script may look or behave a little differently):
0 commit comments