RunHelix.ps1 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <#
  2. .SYNOPSIS
  3. Runs the specified test project on a Helix machine.
  4. .DESCRIPTION
  5. This script runs the Helix msbuild task on the given project and publishes then uploads the output and runs tests on the Helix machine(s) passed in.
  6. .PARAMETER Project
  7. The test project to publish and send to Helix.
  8. .PARAMETER HelixQueues
  9. Set the Helix queues to use. The list is '+' or ';'-separated.
  10. Some supported queues:
  11. Ubuntu.1804.Amd64.Open
  12. Ubuntu.2004.Amd64.Open
  13. Windows.10.Amd64.Server20H2.Open
  14. Windows.81.Amd64.Open
  15. Windows.7.Amd64.Open
  16. OSX.1014.Amd64.Open
  17. Debian.9.Amd64.Open
  18. Redhat.7.Amd64.Open
  19. .PARAMETER RunQuarantinedTests
  20. By default quarantined tests are not run. Set this to $true to run only the quarantined tests.
  21. .PARAMETER TargetArchitecture
  22. The CPU architecture to build for (x64, x86, arm). Default=x64
  23. .PARAMETER MSBuildArguments
  24. Additional MSBuild arguments to be passed through.
  25. #>
  26. [CmdletBinding(PositionalBinding = $false)]
  27. param(
  28. [Parameter(Mandatory=$true)]
  29. [string]$Project,
  30. [string]$HelixQueues = "Windows.10.Amd64.Server20H2.Open",
  31. [switch]$RunQuarantinedTests,
  32. [ValidateSet('x64', 'x86', 'arm', 'arm64')]
  33. [string]$TargetArchitecture = "x64",
  34. # Capture the rest
  35. [Parameter(ValueFromRemainingArguments = $true)]
  36. [string[]]$MSBuildArguments
  37. )
  38. $ErrorActionPreference = 'Stop'
  39. $ProgressPreference = 'SilentlyContinue' # Workaround PowerShell/PowerShell#2138
  40. Set-StrictMode -Version 1
  41. $env:BUILD_REASON="PullRequest"
  42. $env:BUILD_SOURCEBRANCH="local"
  43. $env:BUILD_REPOSITORY_NAME="aspnetcore"
  44. $env:SYSTEM_TEAMPROJECT="aspnetcore"
  45. Write-Host -ForegroundColor Yellow "If running tests that need the shared Fx, run './build -pack -all' before this."
  46. Write-Host -ForegroundColor Yellow "And if packing for a different platform, add '/p:CrossgenOutput=false'."
  47. $HelixQueues = $HelixQueues -replace ";", "%3B"
  48. dotnet msbuild $Project /t:Helix /p:TargetArchitecture="$TargetArchitecture" /p:IsRequiredCheck=true `
  49. /p:IsHelixDaily=true /p:HelixTargetQueues=$HelixQueues /p:RunQuarantinedTests=$RunQuarantinedTests `
  50. /p:_UseHelixOpenQueues=true /p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log `
  51. @MSBuildArguments