Run the LocalTests in CI (#15770)

It was very bad. We had to disable 14 failing tests.
This commit is contained in:
Dustin L. Howett
2025-12-03 16:22:50 -06:00
committed by GitHub
parent 20998f7628
commit a719970913
5 changed files with 94 additions and 0 deletions

View File

@@ -87,6 +87,13 @@ stages:
buildConfigurations: [Release]
buildEverything: true
keepAllExpensiveBuildOutputs: false
${{ if eq(parameters.runTests, true) }}:
# Copy the appx files into the bin drop because the LocalTests need them
afterBuildSteps:
- pwsh: |-
$deps = ./build/scripts/Get-DependenciesFromAppxRecipe.ps1 -Path "$(Terminal.BinDir)/TestHostApp/TestHostApp.build.appxrecipe"
$dir = New-Item -Type Directory "$(Terminal.BinDir)/_testDeps"
$deps | Copy-Item -Destination $dir -Verbose
- ${{ if eq(parameters.runTests, true) }}:
- stage: Test_${{ platform }}

View File

@@ -71,6 +71,9 @@ parameters:
- name: enableCaching
type: boolean
default: false
- name: afterBuildSteps
type: stepList
default: []
jobs:
- job: ${{ parameters.jobName }}
@@ -210,6 +213,8 @@ jobs:
contents: $(Build.SourcesDirectory)/MSBuildCacheLogs/**
TargetFolder: $(Terminal.BinDir)/MSBuildCacheLogs
- ${{ parameters.afterBuildSteps }}
# This saves ~2GiB per architecture. We won't need these later.
# Removes:
# - All .lib that do not have an associated .exp (which would indicate that they are import libs)

View File

@@ -58,6 +58,24 @@ jobs:
filePath: build\scripts\Run-Tests.ps1
arguments: -MatchPattern '*feature.test*.dll' -Platform '$(OutputBuildPlatform)' -Configuration '$(BuildConfiguration)' -LogPath '${{ parameters.testLogPath }}' -Root "$(Terminal.BinDir)"
# Load-bearing: This needs to be Windows PowerShell, not pwsh, due to Add-AppxPackage not working in pwsh.
- powershell: |-
$deps = Get-ChildItem -Recurse "$(Terminal.BinDir)/_testDeps"
$deps | % {
Write-Host "Installing $($_.FullName)..."
Add-AppxPackage -Path $_.FullName -ErrorAction:Ignore
}
displayName: 'Install LocalTest Dependencies'
- task: PowerShell@2
displayName: 'Run Local Tests'
inputs:
pwsh: true
targetType: filePath
filePath: build\scripts\Run-Tests.ps1
arguments: -MatchPattern '*LocalTests*.dll' -Platform '$(OutputBuildPlatform)' -Configuration '$(BuildConfiguration)' -LogPath '${{ parameters.testLogPath }}' -Root "$(Terminal.BinDir)"
condition: and(succeeded(), ne(variables['PGOBuildMode'], 'Instrument'))
- task: PowerShell@2
displayName: 'Convert Test Logs from WTL to xUnit format'
condition: always()

View File

@@ -0,0 +1,17 @@
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true, ValueFromPipeline=$true,
HelpMessage="Path to the .appxrecipe to parse")]
[string]
$Path
)
$Recipe = [xml](Get-Content $Path)
$ResolvedSDKReferences = $Recipe.Project.ItemGroup.ResolvedSDKReference
$ResolvedSDKReferences |
Where-Object Architecture -eq $Recipe.Project.PropertyGroup.PackageArchitecture |
ForEach-Object {
$l = [Uri]::UnescapeDataString($_.AppxLocation)
Get-Item $l
}