Visual Studio Online build definitions & tasks have certainly come a long way since the old xaml template days. There is even a VSO extensions market place. For my current project we are using good old PowerShell based tasks which work together to continuously deploy the solution from VSO to a single node Azure VM Service Fabric cluster which runs all unit, integration and automated UI tests. Some PowerShell snippets which I’ve found helpful along the way are detailed below.
The following task snippet is used to check that a Service Fabric hosted Web endpoint is reachable and ready for integration and UI testing:
$statuscode = 0
Logs the content of a test settings xml file and filters out any keys containing the string “Secret”:
[xml]$testSettings = Get-Content -Path $args
For xUnit tests the provided Visual Studio Test step can be configured with multiple target assemblies separated by a “;” character and wherever possible enable Run In Parallel. Also note to be careful not to end the line with a “;” character as VSO will think there is a missing assembly! For example:
Execution Options >> Test Assembly
Advanced Execution Options >> Path to Custom Test Adapters