After Azure => Pipelines
, I end up with two published artifacts: one containing a .NET Core Console Application (myDrop
), another containing the corresponding Testing library (written with xUnit) (myTestDrop
). Then I move on to Azure => Releases
to create a new Release Pipeline as below:
I have a Windows Virtual Machine (VM), which is already installed with all necessary libraries, e.g. .NET Core; and I would like to carry out the Integration Testing (the 2nd Stage above) in that machine. Specifically,
myDrop
and myTestDrop
to that VM.MyConsole.exe
in myDrop
.dotnet vstest "MyConsole.Tests.dll" --logger:trx --ResultsDirectory:"c:/Somewhere" /TestCaseFilter:"Category=IntegrationTest"
dotnet.exe
is 0
(otherwise, 1
).*.trx
generated from the Integration Test above, especially in case there are some test failures.My experience with Azure DevOps is limited. I have searched around but most Azure Release examples involve Web Application (IIS, SQL...), not a normal Console Application with Test on a specific VM. Feel free to suggest other alternatives or best practices, given the scenario above.
Any advice, suggestions are appreciated.
How to carry out a Test Stage at a specific virtual machine?
You can install and use a self-hosted agent in that machine. Please refer to this document to install Self-hosted Windows agents. You need to add an agent job to the release pipeline first. Then, choose the agent pool with self-hosted agent installed.
Copy both myDrop and myTestDrop to that VM.
Since your agent is installed on the VM, it will automatically download artifacts to its local folder.
The 3rd Stage only runs in case the 2nd Stage is successful.
You can select “After Stage” trigger in pre-deployment conditions. For example, if the test stage in your screenshot fails, the deployment stage will not deploy.
There should be a way to read *.trx generated from the Integration Test above, especially in case there are some test failures.
You can check the test results in the Tests tab of the release result page. You can also download the *.trx file on this page.