mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-11 04:38:24 -06:00
Move PGO Helix pools (#11028)
Moves PGO runs to supported Helix pools. We need to match Microsoft-UI-XAML on which Helix pools we used for each type of activities. ## PR Checklist * [x] Closes #10850 * [x] I work here * [x] If it builds, it sits. ## Validation Steps Performed * [x] Run PGO build against this branch
This commit is contained in:
parent
2c5a35f1be
commit
817f598e20
@ -21,7 +21,7 @@ Write-Host "Checking test results..."
|
|||||||
$queryUri = GetQueryTestRunsUri -CollectionUri $CollectionUri -TeamProject $TeamProject -BuildUri $BuildUri -IncludeRunDetails
|
$queryUri = GetQueryTestRunsUri -CollectionUri $CollectionUri -TeamProject $TeamProject -BuildUri $BuildUri -IncludeRunDetails
|
||||||
Write-Host "queryUri = $queryUri"
|
Write-Host "queryUri = $queryUri"
|
||||||
|
|
||||||
$testRuns = Invoke-RestMethod -Uri $queryUri -Method Get -Headers $azureDevOpsRestApiHeaders
|
$testRuns = Invoke-RestMethodWithRetries $queryUri -Headers $azureDevOpsRestApiHeaders
|
||||||
[System.Collections.Generic.List[string]]$failingTests = @()
|
[System.Collections.Generic.List[string]]$failingTests = @()
|
||||||
[System.Collections.Generic.List[string]]$unreliableTests = @()
|
[System.Collections.Generic.List[string]]$unreliableTests = @()
|
||||||
[System.Collections.Generic.List[string]]$unexpectedResultTest = @()
|
[System.Collections.Generic.List[string]]$unexpectedResultTest = @()
|
||||||
@ -50,7 +50,7 @@ foreach ($testRun in ($testRuns.value | Sort-Object -Property "completedDate" -D
|
|||||||
$totalTestsExecutedCount += $testRun.totalTests
|
$totalTestsExecutedCount += $testRun.totalTests
|
||||||
|
|
||||||
$testRunResultsUri = "$($testRun.url)/results?api-version=5.0"
|
$testRunResultsUri = "$($testRun.url)/results?api-version=5.0"
|
||||||
$testResults = Invoke-RestMethod -Uri "$($testRun.url)/results?api-version=5.0" -Method Get -Headers $azureDevOpsRestApiHeaders
|
$testResults = Invoke-RestMethodWithRetries "$($testRun.url)/results?api-version=5.0" -Headers $azureDevOpsRestApiHeaders
|
||||||
|
|
||||||
foreach ($testResult in $testResults.value)
|
foreach ($testResult in $testResults.value)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -20,13 +20,31 @@ function Generate-File-Links
|
|||||||
Out-File -FilePath $helixLinkFile -Append -InputObject "<ul>"
|
Out-File -FilePath $helixLinkFile -Append -InputObject "<ul>"
|
||||||
foreach($file in $files)
|
foreach($file in $files)
|
||||||
{
|
{
|
||||||
Out-File -FilePath $helixLinkFile -Append -InputObject "<li><a href=$($file.Link)>$($file.Name)</a></li>"
|
$url = Append-HelixAccessTokenToUrl $file.Link "{Your-Helix-Access-Token-Here}"
|
||||||
|
Out-File -FilePath $helixLinkFile -Append -InputObject "<li>$($url)</li>"
|
||||||
}
|
}
|
||||||
Out-File -FilePath $helixLinkFile -Append -InputObject "</ul>"
|
Out-File -FilePath $helixLinkFile -Append -InputObject "</ul>"
|
||||||
Out-File -FilePath $helixLinkFile -Append -InputObject "</div>"
|
Out-File -FilePath $helixLinkFile -Append -InputObject "</div>"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Append-HelixAccessTokenToUrl
|
||||||
|
{
|
||||||
|
Param ([string]$url, [string]$token)
|
||||||
|
if($token)
|
||||||
|
{
|
||||||
|
if($url.Contains("?"))
|
||||||
|
{
|
||||||
|
$url = "$($url)&access_token=$($token)"
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$url = "$($url)?access_token=$($token)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $url
|
||||||
|
}
|
||||||
|
|
||||||
#Create output directory
|
#Create output directory
|
||||||
New-Item $OutputFolder -ItemType Directory
|
New-Item $OutputFolder -ItemType Directory
|
||||||
|
|
||||||
@ -63,7 +81,8 @@ foreach ($testRun in $testRuns.value)
|
|||||||
if (-not $workItems.Contains($workItem))
|
if (-not $workItems.Contains($workItem))
|
||||||
{
|
{
|
||||||
$workItems.Add($workItem)
|
$workItems.Add($workItem)
|
||||||
$filesQueryUri = "https://helix.dot.net/api/2019-06-17/jobs/$helixJobId/workitems/$helixWorkItemName/files$accessTokenParam"
|
$filesQueryUri = "https://helix.dot.net/api/2019-06-17/jobs/$helixJobId/workitems/$helixWorkItemName/files"
|
||||||
|
$filesQueryUri = Append-HelixAccessTokenToUrl $filesQueryUri $helixAccessToken
|
||||||
$files = Invoke-RestMethodWithRetries $filesQueryUri
|
$files = Invoke-RestMethodWithRetries $filesQueryUri
|
||||||
|
|
||||||
$screenShots = $files | where { $_.Name.EndsWith(".jpg") }
|
$screenShots = $files | where { $_.Name.EndsWith(".jpg") }
|
||||||
@ -102,6 +121,7 @@ foreach ($testRun in $testRuns.value)
|
|||||||
|
|
||||||
Write-Host "Downloading $link to $destination"
|
Write-Host "Downloading $link to $destination"
|
||||||
|
|
||||||
|
$link = Append-HelixAccessTokenToUrl $link $HelixAccessToken
|
||||||
Download-FileWithRetries $link $destination
|
Download-FileWithRetries $link $destination
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,7 +23,7 @@ Write-Host "queryUri = $queryUri"
|
|||||||
# To account for unreliable tests, we'll iterate through all of the tests associated with this build, check to see any tests that were unreliable
|
# To account for unreliable tests, we'll iterate through all of the tests associated with this build, check to see any tests that were unreliable
|
||||||
# (denoted by being marked as "skipped"), and if so, we'll instead mark those tests with a warning and enumerate all of the attempted runs
|
# (denoted by being marked as "skipped"), and if so, we'll instead mark those tests with a warning and enumerate all of the attempted runs
|
||||||
# with their pass/fail states as well as any relevant error messages for failed attempts.
|
# with their pass/fail states as well as any relevant error messages for failed attempts.
|
||||||
$testRuns = Invoke-RestMethod -Uri $queryUri -Method Get -Headers $azureDevOpsRestApiHeaders
|
$testRuns = Invoke-RestMethodWithRetries $queryUri -Headers $azureDevOpsRestApiHeaders
|
||||||
|
|
||||||
$timesSeenByRunName = @{}
|
$timesSeenByRunName = @{}
|
||||||
|
|
||||||
@ -32,10 +32,10 @@ foreach ($testRun in $testRuns.value)
|
|||||||
$testRunResultsUri = "$($testRun.url)/results?api-version=5.0"
|
$testRunResultsUri = "$($testRun.url)/results?api-version=5.0"
|
||||||
|
|
||||||
Write-Host "Marking test run `"$($testRun.name)`" as in progress so we can change its results to account for unreliable tests."
|
Write-Host "Marking test run `"$($testRun.name)`" as in progress so we can change its results to account for unreliable tests."
|
||||||
Invoke-RestMethod -Uri "$($testRun.url)?api-version=5.0" -Method Patch -Body (ConvertTo-Json @{ "state" = "InProgress" }) -Headers $azureDevOpsRestApiHeaders -ContentType "application/json" | Out-Null
|
Invoke-RestMethod "$($testRun.url)?api-version=5.0" -Method Patch -Body (ConvertTo-Json @{ "state" = "InProgress" }) -Headers $azureDevOpsRestApiHeaders -ContentType "application/json" | Out-Null
|
||||||
|
|
||||||
Write-Host "Retrieving test results..."
|
Write-Host "Retrieving test results..."
|
||||||
$testResults = Invoke-RestMethod -Uri $testRunResultsUri -Method Get -Headers $azureDevOpsRestApiHeaders
|
$testResults = Invoke-RestMethodWithRetries $testRunResultsUri -Headers $azureDevOpsRestApiHeaders
|
||||||
|
|
||||||
foreach ($testResult in $testResults.value)
|
foreach ($testResult in $testResults.value)
|
||||||
{
|
{
|
||||||
@ -54,7 +54,8 @@ foreach ($testRun in $testRuns.value)
|
|||||||
Write-Host " Test $($testResult.testCaseTitle) was detected as unreliable. Updating..."
|
Write-Host " Test $($testResult.testCaseTitle) was detected as unreliable. Updating..."
|
||||||
|
|
||||||
# The errorMessage field contains a link to the JSON-encoded rerun result data.
|
# The errorMessage field contains a link to the JSON-encoded rerun result data.
|
||||||
$rerunResults = ConvertFrom-Json (New-Object System.Net.WebClient).DownloadString($testResult.errorMessage)
|
$resultsJson = Download-StringWithRetries "Error results" $testResult.errorMessage
|
||||||
|
$rerunResults = ConvertFrom-Json $resultsJson
|
||||||
[System.Collections.Generic.List[System.Collections.Hashtable]]$rerunDataList = @()
|
[System.Collections.Generic.List[System.Collections.Hashtable]]$rerunDataList = @()
|
||||||
$attemptCount = 0
|
$attemptCount = 0
|
||||||
$passCount = 0
|
$passCount = 0
|
||||||
|
|||||||
@ -3,7 +3,7 @@ parameters:
|
|||||||
platform: ''
|
platform: ''
|
||||||
additionalBuildArguments: ''
|
additionalBuildArguments: ''
|
||||||
minimumExpectedTestsExecutedCount: 1 # Sanity check for minimum expected tests to be reported
|
minimumExpectedTestsExecutedCount: 1 # Sanity check for minimum expected tests to be reported
|
||||||
rerunPassesRequiredToAvoidFailure: 0
|
rerunPassesRequiredToAvoidFailure: 5
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
- job: Build${{ parameters.platform }}${{ parameters.configuration }}
|
- job: Build${{ parameters.platform }}${{ parameters.configuration }}
|
||||||
|
|||||||
@ -22,6 +22,7 @@ jobs:
|
|||||||
condition: succeededOrFailed()
|
condition: succeededOrFailed()
|
||||||
env:
|
env:
|
||||||
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
||||||
|
HelixAccessToken: $(HelixApiAccessToken)
|
||||||
inputs:
|
inputs:
|
||||||
targetType: filePath
|
targetType: filePath
|
||||||
filePath: build\Helix\UpdateUnreliableTests.ps1
|
filePath: build\Helix\UpdateUnreliableTests.ps1
|
||||||
@ -32,6 +33,7 @@ jobs:
|
|||||||
condition: succeededOrFailed()
|
condition: succeededOrFailed()
|
||||||
env:
|
env:
|
||||||
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
||||||
|
HelixAccessToken: $(HelixApiAccessToken)
|
||||||
inputs:
|
inputs:
|
||||||
targetType: filePath
|
targetType: filePath
|
||||||
filePath: build\Helix\OutputTestResults.ps1
|
filePath: build\Helix\OutputTestResults.ps1
|
||||||
|
|||||||
@ -15,6 +15,7 @@ parameters:
|
|||||||
# if 'useBuildOutputFromBuildId' is set, we will default to using a build from this pipeline:
|
# if 'useBuildOutputFromBuildId' is set, we will default to using a build from this pipeline:
|
||||||
useBuildOutputFromPipeline: $(System.DefinitionId)
|
useBuildOutputFromPipeline: $(System.DefinitionId)
|
||||||
openHelixTargetQueues: 'windows.10.amd64.client19h1.open.xaml'
|
openHelixTargetQueues: 'windows.10.amd64.client19h1.open.xaml'
|
||||||
|
closedHelixTargetQueues: 'windows.10.amd64.client19h1.xaml'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
- job: ${{ parameters.name }}
|
- job: ${{ parameters.name }}
|
||||||
@ -29,11 +30,11 @@ jobs:
|
|||||||
buildConfiguration: ${{ parameters.configuration }}
|
buildConfiguration: ${{ parameters.configuration }}
|
||||||
buildPlatform: ${{ parameters.platform }}
|
buildPlatform: ${{ parameters.platform }}
|
||||||
openHelixTargetQueues: ${{ parameters.openHelixTargetQueues }}
|
openHelixTargetQueues: ${{ parameters.openHelixTargetQueues }}
|
||||||
|
closedHelixTargetQueues: ${{ parameters.closedHelixTargetQueues }}
|
||||||
artifactsDir: $(Build.SourcesDirectory)\Artifacts
|
artifactsDir: $(Build.SourcesDirectory)\Artifacts
|
||||||
taefPath: $(Build.SourcesDirectory)\build\Helix\packages\Microsoft.Taef.10.60.210621002\build\Binaries\$(buildPlatform)
|
taefPath: $(Build.SourcesDirectory)\build\Helix\packages\Microsoft.Taef.10.60.210621002\build\Binaries\$(buildPlatform)
|
||||||
helixCommonArgs: '/binaryLogger:$(Build.SourcesDirectory)/${{parameters.name}}.$(buildPlatform).$(buildConfiguration).binlog /p:HelixBuild=$(Build.BuildId).$(buildPlatform).$(buildConfiguration) /p:Platform=$(buildPlatform) /p:Configuration=$(buildConfiguration) /p:HelixType=${{parameters.helixType}} /p:TestSuite=${{parameters.testSuite}} /p:ProjFilesPath=$(Build.ArtifactStagingDirectory) /p:rerunPassesRequiredToAvoidFailure=${{parameters.rerunPassesRequiredToAvoidFailure}}'
|
helixCommonArgs: '/binaryLogger:$(Build.SourcesDirectory)/${{parameters.name}}.$(buildPlatform).$(buildConfiguration).binlog /p:HelixBuild=$(Build.BuildId).$(buildPlatform).$(buildConfiguration) /p:Platform=$(buildPlatform) /p:Configuration=$(buildConfiguration) /p:HelixType=${{parameters.helixType}} /p:TestSuite=${{parameters.testSuite}} /p:ProjFilesPath=$(Build.ArtifactStagingDirectory) /p:rerunPassesRequiredToAvoidFailure=${{parameters.rerunPassesRequiredToAvoidFailure}}'
|
||||||
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- task: CmdLine@1
|
- task: CmdLine@1
|
||||||
displayName: 'Display build machine environment variables'
|
displayName: 'Display build machine environment variables'
|
||||||
@ -140,6 +141,7 @@ jobs:
|
|||||||
|
|
||||||
- task: DotNetCoreCLI@2
|
- task: DotNetCoreCLI@2
|
||||||
displayName: 'Run tests in Helix (open queues)'
|
displayName: 'Run tests in Helix (open queues)'
|
||||||
|
condition: and(succeeded(),eq(variables['System.CollectionUri'],'https://dev.azure.com/ms/'))
|
||||||
env:
|
env:
|
||||||
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
||||||
inputs:
|
inputs:
|
||||||
@ -147,3 +149,15 @@ jobs:
|
|||||||
projects: build\Helix\RunTestsInHelix.proj
|
projects: build\Helix\RunTestsInHelix.proj
|
||||||
custom: msbuild
|
custom: msbuild
|
||||||
arguments: '$(helixCommonArgs) /p:IsExternal=true /p:Creator=Terminal /p:HelixTargetQueues=$(openHelixTargetQueues)'
|
arguments: '$(helixCommonArgs) /p:IsExternal=true /p:Creator=Terminal /p:HelixTargetQueues=$(openHelixTargetQueues)'
|
||||||
|
|
||||||
|
- task: DotNetCoreCLI@2
|
||||||
|
displayName: 'Run tests in Helix (closed queues)'
|
||||||
|
condition: and(succeeded(),ne(variables['System.CollectionUri'],'https://dev.azure.com/ms/'))
|
||||||
|
env:
|
||||||
|
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
||||||
|
HelixAccessToken: $(HelixApiAccessToken)
|
||||||
|
inputs:
|
||||||
|
command: custom
|
||||||
|
projects: build\Helix\RunTestsInHelix.proj
|
||||||
|
custom: msbuild
|
||||||
|
arguments: '$(helixCommonArgs) /p:HelixTargetQueues=$(closedHelixTargetQueues)'
|
||||||
|
|||||||
@ -20,11 +20,15 @@ jobs:
|
|||||||
inputs:
|
inputs:
|
||||||
artifactName: ${{ parameters.pgoArtifact }}
|
artifactName: ${{ parameters.pgoArtifact }}
|
||||||
downloadPath: $(artifactsPath)
|
downloadPath: $(artifactsPath)
|
||||||
|
|
||||||
- task: NuGetToolInstaller@0
|
- task: NuGetAuthenticate@0
|
||||||
displayName: 'Use NuGet 5.2.0'
|
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: 5.2.0
|
nuGetServiceConnections: 'Terminal Public Artifact Feed'
|
||||||
|
|
||||||
|
- task: NuGetToolInstaller@0
|
||||||
|
displayName: 'Use NuGet 5.8.0'
|
||||||
|
inputs:
|
||||||
|
versionSpec: 5.8.0
|
||||||
|
|
||||||
- task: CopyFiles@2
|
- task: CopyFiles@2
|
||||||
displayName: 'Copy pgd files to NuGet build directory'
|
displayName: 'Copy pgd files to NuGet build directory'
|
||||||
@ -58,5 +62,11 @@ jobs:
|
|||||||
displayName: 'NuGet push'
|
displayName: 'NuGet push'
|
||||||
inputs:
|
inputs:
|
||||||
command: push
|
command: push
|
||||||
publishVstsFeed: Terminal/TerminalDependencies
|
nuGetFeedType: external
|
||||||
packagesToPush: $(Build.ArtifactStagingDirectory)/*.nupkg
|
packagesToPush: $(Build.ArtifactStagingDirectory)/*.nupkg
|
||||||
|
# The actual URL and PAT for this feed is configured at
|
||||||
|
# https://microsoft.visualstudio.com/Dart/_settings/adminservices
|
||||||
|
# This is the name of that connection
|
||||||
|
publishFeedCredentials: 'Terminal Public Artifact Feed'
|
||||||
|
feedsToUse: config
|
||||||
|
nugetConfigPath: '$(Build.SourcesDirectory)/NuGet.config'
|
||||||
Loading…
x
Reference in New Issue
Block a user