Skip to content

Commit d40322d

Browse files
committed
Test isolation
1 parent 0caa4a7 commit d40322d

File tree

2 files changed

+55
-21
lines changed

2 files changed

+55
-21
lines changed

appveyor.yml

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -49,24 +49,4 @@ for:
4949
Get-ChildItem buildoutput\*.zip | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name -DeploymentName "Runtime" }
5050
test_script:
5151
- ps: >
52-
$success = $true
53-
54-
# dotnet test .\test\WebJobs.Script.Scaling.Tests\ -v q --no-build -p:ParallelizeTestCollections=false
55-
56-
# dotnet test .\test\WebJobs.Script.Tests\ -v q --no-build -p:ParallelizeTestCollections=false
57-
58-
# see results in app insights AntaresDemo 'functionse2eai'
59-
60-
dotnet test .\test\WebJobs.Script.Tests -v q --no-build
61-
62-
$success = $success -and $?
63-
64-
dotnet test .\test\WebJobs.Script.Scaling.Tests -v q --no-build
65-
66-
$success = $success -and $?
67-
68-
dotnet test .\test\WebJobs.Script.Tests.Integration\ -v q --no-build
69-
70-
$success = $success -and $?
71-
72-
if (-not $success) { exit 1 }
52+
.\run-tests.ps1

run-tests.ps1

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
2+
function RunTest([string] $project, [string] $description,[bool] $skipBuild = $false, $filter = $null) {
3+
Write-Host "Running test: $description" -ForegroundColor DarkCyan
4+
Write-Host "-----------------------------------------------------------------------------" -ForegroundColor DarkCyan
5+
Write-Host
6+
7+
$cmdargs = "test", ".\test\$project\", "-v", "q"
8+
9+
if ($filter) {
10+
$cmdargs += "--filter", "$filter"
11+
}
12+
13+
# We'll always rebuild for now.
14+
# if ($skipBuild){
15+
# $cmdargs += "--no-build"
16+
# }
17+
# else {
18+
# Write-Host "Rebuilding project" -ForegroundColor Red
19+
# }
20+
21+
& dotnet $cmdargs | Out-Host
22+
$r = $?
23+
24+
Write-Host
25+
Write-Host "-----------------------------------------------------------------------------" -ForegroundColor DarkCyan
26+
Write-Host
27+
28+
return $r
29+
}
30+
31+
32+
$tests = @(
33+
@{project ="WebJobs.Script.Tests"; description="Unit Tests"},
34+
@{project ="WebJobs.Script.Scaling.Tests"; description="Scaling Tests"},
35+
@{project ="WebJobs.Script.Tests.Integration"; description="Non-E2E integration tests"; filter ="Category!=E2E"},
36+
@{project ="WebJobs.Script.Tests.Integration"; description="C# end to end tests"; filter ="E2E=CSharpEndToEndTests"},
37+
@{project ="WebJobs.Script.Tests.Integration"; description="Node end to end tests"; filter ="E2E=NodeEndToEndTests"},
38+
@{project ="WebJobs.Script.Tests.Integration"; description="Direct load end to end tests"; filter ="E2E=DirectLoadEndToEndTests"},
39+
@{project ="WebJobs.Script.Tests.Integration"; description="F# end to end tests"; filter ="E2E=FSharpEndToEndTests"},
40+
@{project ="WebJobs.Script.Tests.Integration"; description="Language worker end to end tests"; filter ="E2E=LanguageWorkerSelectionEndToEndTests"},
41+
@{project ="WebJobs.Script.Tests.Integration"; description="Node script host end to end tests"; filter ="E2E=NodeScriptHostTests"},
42+
@{project ="WebJobs.Script.Tests.Integration"; description="Raw assembly end to end tests"; filter ="E2E=RawAssemblyEndToEndTests"},
43+
@{project ="WebJobs.Script.Tests.Integration"; description="Samples end to end tests"; filter ="E2E=SamplesEndToEndTests"}
44+
)
45+
46+
$success = $true
47+
$testRunSucceeded = $true
48+
49+
foreach ($test in $tests){
50+
$testRunSucceeded = RunTest $test.project $test.description $testRunSucceeded $test.filter
51+
$success = $testRunSucceeded -and $success
52+
}
53+
54+
if (-not $success) { exit 1 }

0 commit comments

Comments
 (0)