forked from dotnet/sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runHelixAndNonHelixInParallel.ps1
48 lines (42 loc) · 1.84 KB
/
runHelixAndNonHelixInParallel.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
48
[CmdletBinding(PositionalBinding = $false)]
Param(
[string] $configuration,
[string] $buildSourcesDirectory,
[string] $customHelixTargetQueue,
[string] $additionalMSBuildParameters = "",
[switch] $test
)
if (-not $test)
{
Write-Output "No '-test' switch. Skip both helix and non helix tests"
return
}
workflow runHelixAndNonHelixInParallel
{
Param(
[string] $configuration,
[string] $buildSourcesDirectory,
[string] $customHelixTargetQueue,
[string] $engfolderPath,
[string[]] $additionalParameters
)
$runTestsCannotRunOnHelixArgs = ("-configuration", $configuration, "-ci")
$runTestsOnHelixArgs = ("-configuration", $configuration,
"-ci",
"-restore",
"-test",
"-projects", "$buildSourcesDirectory/src/Tests/UnitTests.proj",
"/bl:$buildSourcesDirectory\artifacts\log\$configuration\TestInHelix.binlog",
"/p:_CustomHelixTargetQueue=$customHelixTargetQueue") + $additionalParameters
parallel {
Write-Output "&'$engfolderPath\common\build.ps1' $runTestsOnHelixArgs"
Invoke-Expression "&'$engfolderPath\common\build.ps1' $runTestsOnHelixArgs"
}
}
runHelixAndNonHelixInParallel -configuration $configuration -buildSourcesDirectory $buildSourcesDirectory -customHelixTargetQueue $customHelixTargetQueue -engfolderPath $PSScriptRoot -additionalParameters $additionalMSBuildParameters.Split(' ')
# An array of names of processes to stop on script exit
$processesToStopOnExit = @('msbuild', 'dotnet', 'vbcscompiler')
Write-Host 'Stopping running build processes...'
foreach ($processName in $processesToStopOnExit) {
Get-Process -Name $processName -ErrorAction SilentlyContinue | Stop-Process
}