Created
December 6, 2017 15:14
-
-
Save the-tatarinov-av/951b301598c3badfba69b97805a0944d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $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