Skip to content

Commit

Permalink
Add integration test script runner
Browse files Browse the repository at this point in the history
  • Loading branch information
gjunge committed Aug 14, 2017
1 parent 6fed882 commit 96d0411
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions SolrNet.Tests.Integration/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
<package id="xunit.core" version="2.2.0" targetFramework="net46" />
<package id="xunit.extensibility.core" version="2.2.0" targetFramework="net46" />
<package id="xunit.extensibility.execution" version="2.2.0" targetFramework="net46" />
<package id="xunit.runner.console" version="2.2.0" targetFramework="net46" developmentDependency="true" />
<package id="xunit.runner.visualstudio" version="2.2.0" targetFramework="net46" developmentDependency="true" />
</packages>
47 changes: 47 additions & 0 deletions run-integrationtests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
Write-Output "Starting SOLR"
Set-Location .\solr
$solr = start-process java -argumentlist "-jar start.jar" -PassThru

for($i=1; $i -le 10; $i++)
{
try {
$response = Invoke-WebRequest "http://127.0.0.1:8983/solr"
Write-Output "Solr is running"
break;
}
catch {
$_.Exception.Response.StatusCode.Value__
Write-Warning "$i/10 Solr not ready yet"
}

if ($i -eq 10)
{
Write-Error "Solr is not running"
Stop-Process $solr.Id
exit
}


Start-Sleep -s 1
}

Set-Location ..
Write-Output "Start running tests"

$tests = Get-ChildItem -path . -Recurse -Include *Test*.dll | where { $_.FullName -match "$($_.name.substring(0,$_.name.length - 4))\\bin" }

foreach($test in $tests)
{
.\packages\xunit.runner.console.2.2.0\tools\xunit.console.exe $test -trait "Category=Integration"
if ($LASTEXITCODE -ne 0 )
{
Write-Error "Abort test run, last test failed"
break
}
}




Write-Output "Shutting down SOLR"
Stop-Process $solr.Id

0 comments on commit 96d0411

Please sign in to comment.