RunHelix.ps1 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. Debian.11.Amd64.Open
  12. Mariner
  13. Redhat.7.Amd64.Open
  14. Ubuntu.1804.Amd64.Open
  15. Ubuntu.2004.Amd64.Open
  16. OSX.1015.Amd64.Open
  17. OSX.1100.Amd64.Open
  18. Windows.10.Amd64.Server20H2.Open
  19. Windows.11.Amd64.ClientPre.Open
  20. Windows.Amd64.Server2022.Open
  21. .PARAMETER RunQuarantinedTests
  22. By default quarantined tests are not run. Set this to $true to run only the quarantined tests.
  23. .PARAMETER TargetArchitecture
  24. The CPU architecture to build for (x64, x86, arm). Default=x64
  25. .PARAMETER MSBuildArguments
  26. Additional MSBuild arguments to be passed through.
  27. #>
  28. [CmdletBinding(PositionalBinding = $false)]
  29. param(
  30. [Parameter(Mandatory=$true)]
  31. [string]$Project,
  32. [string]$HelixQueues = "Windows.10.Amd64.Server20H2.Open",
  33. [switch]$RunQuarantinedTests,
  34. [ValidateSet('x64', 'x86', 'arm', 'arm64')]
  35. [string]$TargetArchitecture = "x64",
  36. # Capture the rest
  37. [Parameter(ValueFromRemainingArguments = $true)]
  38. [string[]]$MSBuildArguments
  39. )
  40. $ErrorActionPreference = 'Stop'
  41. $ProgressPreference = 'SilentlyContinue' # Workaround PowerShell/PowerShell#2138
  42. Set-StrictMode -Version 1
  43. $env:BUILD_REASON="PullRequest"
  44. $env:BUILD_SOURCEBRANCH="local"
  45. $env:BUILD_REPOSITORY_NAME="aspnetcore"
  46. $env:SYSTEM_TEAMPROJECT="aspnetcore"
  47. Write-Host -ForegroundColor Yellow "If running tests that need the shared Fx, run './build -pack -all' before this."
  48. Write-Host -ForegroundColor Yellow "And if packing for a different platform, add '/p:CrossgenOutput=false'."
  49. $HelixQueues = $HelixQueues -replace ";", "%3B"
  50. dotnet msbuild $Project /t:Helix /p:TargetArchitecture="$TargetArchitecture" `
  51. /p:HelixTargetQueues=$HelixQueues /p:RunQuarantinedTests=$RunQuarantinedTests `
  52. /p:_UseHelixOpenQueues=true /p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log `
  53. /p:DoNotRequireSharedFxHelix=true @MSBuildArguments