Skip to content

Instantly share code, notes, and snippets.

@the-tatarinov-av
Created December 6, 2017 15:14
Show Gist options
  • Select an option

  • Save the-tatarinov-av/951b301598c3badfba69b97805a0944d to your computer and use it in GitHub Desktop.

Select an option

Save the-tatarinov-av/951b301598c3badfba69b97805a0944d to your computer and use it in GitHub Desktop.
$folder = $args[0]
$configuration = $args[1]
$xunit = $args[2]
$testType = $args[3]
$service = $args[4]
$category = $args[5]
try
{
Start-Transcript -Path C:\output.txt -Append
$testSuite = (gci $folder -Recurse -Include *.$testType.*.dll, *.$testType.dll | Where {$_.FullName -like "*\bin\$configuration*"} | % {$_.FullName}) -join " "
if([string]::IsNullOrWhiteSpace($testSuite))
{
Write-Error ".dll for $testType on folder $folder not found";
Exit(1);
}
Write-Host Found test suit dll: $testSuite
foreach($test in $testSuite.Split(' '))
{
if ([string]::IsNullOrWhiteSpace($category))
{
& $xunit $test
}
else
{
& $xunit $test -trait Category=$category
}
}
Stop-Transcript
}
catch [system.exception]
{
Write-Host $_
exit 11
}
Write-Host "##teamcity[buildStatus text='Integration {build.status.text}']"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment