forked from SolrNet/SolrNet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-integrationtests.ps1
47 lines (36 loc) · 1.02 KB
/
run-integrationtests.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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