Skip to content

Instantly share code, notes, and snippets.

@artisticcheese
Created August 10, 2017 17:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save artisticcheese/ff496fd4d06660e6e111dc67af04ec7f to your computer and use it in GitHub Desktop.
Save artisticcheese/ff496fd4d06660e6e111dc67af04ec7f to your computer and use it in GitHub Desktop.
param
(
$tool = "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\MSTest.exe",
$path = $psscriptroot,
$item = "$path\webtest1.webtest",
$results = "$path\webtest.trx",
$testsettings = "$path\Local.testsettings",
$expectedReleaseHeader = "webredirect:20170726_1050",
$urlTest = "http://10.45.122.51:8080"
)
$SLheader
while ($true)
{
try
{
$null = Invoke-WebRequest $urltest -UseBasicParsing -MaximumRedirection 0 -OutVariable SLheaderOut -ErrorAction SilentlyContinue
}
catch
{
Write-Output $_
}
if ($Slheaderout)
{
$SLheader = $Slheaderout.headers.SL
}
else
{
$Slheader = $null
}
if ($SLheader -ieq $expectedReleaseHeader )
{
break
}
else
{
Write-Output "Found $SLheader while expecting $expectedReleaseHeader"
}
Start-Sleep 5
}
Write-Output "Found $Slheader on $urlTest, can proceed with the rest of tests"
${env:Test.EndpointName} = $urlTest
& $tool /TestContainer:$item /resultsfile:$Results /testsettings:$testsettings /noisolation
#Temporary measure untill VSTS is fixed
New-Item -Name "webtest" -Path $psscriptroot -ItemType Directory
move-item -Path (join-path -path $path -Childpath (get-childitem -Path $path -Name "in" -Directory -Recurse)) -Destination $path\webtest
#Install evaluation version of VS 2017 Enterprise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment