azure-functions-dotnet-worker/run-e2e-tests.ps1

34 строки
1.0 KiB
PowerShell

function RunTest([string] $project, [string] $description,[bool] $skipBuild = $false, $filter = $null) {
Write-Host "Running test: $description" -ForegroundColor DarkCyan
Write-Host "-----------------------------------------------------------------------------" -ForegroundColor DarkCyan
Write-Host
$cmdargs = "test", "$project", "-v", "q", "-l", "trx", "-r",".\testResults"
if ($filter) {
$cmdargs += "--filter", "$filter"
}
& dotnet $cmdargs | Out-Host
$r = $?
Write-Host
Write-Host "-----------------------------------------------------------------------------" -ForegroundColor DarkCyan
Write-Host
return $r
}
$tests = @(
@{project ="$PSScriptRoot/test/E2ETests/E2ETests/E2ETests.csproj"; description="E2E integration tests"}
)
$success = $true
$testRunSucceeded = $true
foreach ($test in $tests){
$testRunSucceeded = RunTest $test.project $test.description $testRunSucceeded $test.filter
$success = $testRunSucceeded -and $success
}
if (-not $success) { exit 1 }