Skip to content

Commit

Permalink
Refactor WinUI Helix functionality into reusable WinUI.Helix nuget pa…
Browse files Browse the repository at this point in the history
…ckage (#4678)
  • Loading branch information
kmahone authored Apr 20, 2021
1 parent b3b5fd9 commit 5b757e8
Show file tree
Hide file tree
Showing 27 changed files with 243 additions and 1,884 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
parameters:
condition: ''
testFilePath: ''
testBinaryDirectoryPath: '$(Build.SourcesDirectory)\HelixPayload'
testFilePattern: ''
outputProjFileName: ''
testSuite: ''
taefQuery: ''

steps:
Expand All @@ -12,4 +12,4 @@ steps:
inputs:
targetType: filePath
filePath: build\Helix\GenerateTestProjFile.ps1
arguments: -TestFile '${{ parameters.testFilePath }}' -OutputProjFile '$(Build.ArtifactStagingDirectory)\${{ parameters.outputProjFileName }}' -JobTestSuiteName '${{ parameters.testSuite }}' -TaefPath '$(Build.SourcesDirectory)\build\Helix\packages\taef.redist.wlk.10.31.180822002\build\Binaries\x86' -TaefQuery "${{ parameters.taefQuery }}"
arguments: -TestFilePattern '${{ parameters.testFilePattern }}' -TestBinaryDirectoryPath '${{ parameters.testBinaryDirectoryPath }}' -OutputProjFile '$(Build.ArtifactStagingDirectory)\${{ parameters.outputProjFileName }}' -TaefQuery "${{ parameters.taefQuery }}" -TestNamePrefix $(buildConfiguration).$(buildPlatform)
39 changes: 30 additions & 9 deletions build/AzurePipelinesTemplates/MUX-ProcessTestResults-Job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,51 @@ parameters:

jobs:
- job: ProcessTestResults
condition: succeededOrFailed()
condition: always()
dependsOn: ${{ parameters.dependsOn }}
pool:
vmImage: 'windows-2019'
timeoutInMinutes: 120
variables:
helixOutputFolder: $(Build.SourcesDirectory)\HelixOutput
winuiHelixVersion: 0.0.2.4
helixScriptPath: $(Build.SourcesDirectory)\build\Helix\packages\Microsoft.Internal.WinUI.Helix.$(winuiHelixVersion)\scripts\pipeline
${{if eq(parameters.pgoArtifact, '') }}:
processHelixFilesExtraArgs: ''
${{if ne(parameters.pgoArtifact, '') }}:
processHelixFilesExtraArgs: -ProcessAllJobs

steps:

- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2
displayName: 'NuGet restore build/Helix/packages.config'
inputs:
restoreSolution: build/Helix/packages.config
feedsToUse: config
nugetConfigPath: nuget.config
restoreDirectory: packages

- task: powershell@2
displayName: 'UpdateUnreliableTests.ps1'
condition: succeededOrFailed()
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
HelixAccessToken: $(HelixApiAccessToken)
inputs:
targetType: filePath
filePath: build\Helix\UpdateUnreliableTests.ps1
filePath: $(helixScriptPath)\UpdateUnreliableTests.ps1
arguments: -RerunPassesRequiredToAvoidFailure '${{ parameters.rerunPassesRequiredToAvoidFailure }}'

- task: powershell@2
displayName: 'OutputTestResults.ps1'
condition: succeededOrFailed()
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
HelixAccessToken: $(HelixApiAccessToken)
inputs:
targetType: filePath
filePath: build\Helix\OutputTestResults.ps1
arguments: -MinimumExpectedTestsExecutedCount '${{ parameters.minimumExpectedTestsExecutedCount }}' -CheckJobAttempt $${{ parameters.checkJobAttempt }}
filePath: $(helixScriptPath)\OutputTestResults.ps1
arguments: -MinimumExpectedTestsExecutedCount '${{ parameters.minimumExpectedTestsExecutedCount }}'

- task: powershell@2
displayName: 'ProcessHelixFiles.ps1'
Expand All @@ -44,19 +61,23 @@ jobs:
HelixAccessToken: $(HelixApiAccessToken)
inputs:
targetType: filePath
filePath: build\Helix\ProcessHelixFiles.ps1
arguments: -OutputFolder '$(helixOutputFolder)'
filePath: $(helixScriptPath)\ProcessHelixFiles.ps1
arguments: -OutputFolder '$(helixOutputFolder)' $(processHelixFilesExtraArgs)

- ${{if ne(parameters.pgoArtifact, '') }}:
- script: move /y $(helixOutputFolder)\PGO $(Build.ArtifactStagingDirectory)
displayName: 'Move pgc files to PGO artifact'
- task: powershell@2
displayName: CopyPGOFiles.ps1
inputs:
targetType: filePath
filePath: build\Helix\CopyPGOFiles.ps1
arguments: -SourceFolder '$(helixOutputFolder)' -OutputFolder '$(Build.ArtifactStagingDirectory)'

- task: PublishBuildArtifacts@1
displayName: 'Publish Helix files'
condition: succeededOrFailed()
inputs:
PathtoPublish: $(helixOutputFolder)
artifactName: drop
artifactName: helixTestOutput

- ${{if ne(parameters.pgoArtifact, '') }}:
- task: PublishBuildArtifacts@1
Expand Down
25 changes: 12 additions & 13 deletions build/AzurePipelinesTemplates/MUX-RunHelixTests-Job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ parameters:
name: 'RunTestsInHelix'
dependsOn: ''
condition: ''
testSuite: ''
testSuite: DevTestSuite
helixType: test/devtest
# If a Pipeline runs this template more than once, this parameter should be unique per build flavor to differentiate the
# the different test runs:
helixType: 'test/devtest'
artifactName: 'drop'
maxParallel: 4
rerunPassesRequiredToAvoidFailure: 5
Expand Down Expand Up @@ -42,7 +42,6 @@ jobs:
matrix: ${{ parameters.matrix }}
variables:
artifactsDir: $(Build.SourcesDirectory)\Artifacts
taefPath: $(Build.SourcesDirectory)\build\Helix\packages\taef.redist.wlk.10.31.180822002\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}}'


Expand Down Expand Up @@ -97,33 +96,33 @@ jobs:
- template: MUX-CreateHelixProjFile-Steps.yml
parameters:
condition: and(succeeded(),ne('${{ parameters.testSuite }}','NugetTestSuite'))
testFilePath: '$(artifactsDir)\${{ parameters.artifactName }}\$(buildConfiguration)\$(buildPlatform)\Test\MUXControls.Test.dll'
testBinaryDirectoryPath: '$(Build.SourcesDirectory)\HelixPayload\$(buildConfiguration)\$(buildPlatform)'
testFilePattern: 'MUXControls.Test.dll'
outputProjFileName: 'RunTestsInHelix-InteractionTests.proj'
testSuite: '${{ parameters.testSuite }}'
taefQuery: ${{ parameters.taefQuery }}

- template: MUX-CreateHelixProjFile-Steps.yml
parameters:
condition: and(succeeded(),ne('${{ parameters.testSuite }}','NugetTestSuite'))
testFilePath: '$(artifactsDir)\${{ parameters.artifactName }}\$(buildConfiguration)\$(buildPlatform)\AppxPackages\MUXControlsTestApp_Test\MUXControlsTestApp.appx'
testBinaryDirectoryPath: '$(Build.SourcesDirectory)\HelixPayload\$(buildConfiguration)\$(buildPlatform)'
testFilePattern: 'MUXControlsTestApp.appx'
outputProjFileName: 'RunTestsInHelix-ApiTests.proj'
testSuite: '${{ parameters.testSuite }}'
taefQuery: ${{ parameters.taefQuery }}

- template: MUX-CreateHelixProjFile-Steps.yml
parameters:
condition: and(succeeded(),ne('${{ parameters.testSuite }}','NugetTestSuite'))
testFilePath: '$(artifactsDir)\${{ parameters.artifactName }}\$(buildConfiguration)\$(buildPlatform)\AppxPackages\IXMPTestApp_Test\IXMPTestApp.appx'
testBinaryDirectoryPath: '$(Build.SourcesDirectory)\HelixPayload\$(buildConfiguration)\$(buildPlatform)'
testFilePattern: 'IXMPTestApp.appx'
outputProjFileName: 'RunTestsInHelix-IXMPTestAppTests.proj'
testSuite: '${{ parameters.testSuite }}'
taefQuery: ${{ parameters.taefQuery }}

- template: MUX-CreateHelixProjFile-Steps.yml
parameters:
condition: and(succeeded(),eq('${{ parameters.testSuite }}','NugetTestSuite'))
testFilePath: '$(artifactsDir)\${{ parameters.artifactName }}\$(buildConfiguration)\$(buildPlatform)\Test\MUXControls.ReleaseTest.dll'
testBinaryDirectoryPath: '$(Build.SourcesDirectory)\HelixPayload\$(buildConfiguration)\$(buildPlatform)'
testFilePattern: 'MUXControls.ReleaseTest.dll'
outputProjFileName: 'RunTestsInHelix-NugetTests.proj'
testSuite: '${{ parameters.testSuite }}'
taefQuery: ${{ parameters.taefQuery }}

- task: PublishBuildArtifacts@1
Expand All @@ -134,7 +133,7 @@ jobs:

- task: DotNetCoreCLI@2
displayName: 'Run tests in Helix (open queues)'
condition: eq(variables['System.CollectionUri'],'https://dev.azure.com/ms/')
condition: and(succeeded(),eq(variables['System.CollectionUri'],'https://dev.azure.com/ms/'))
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
inputs:
Expand All @@ -145,7 +144,7 @@ jobs:

- task: DotNetCoreCLI@2
displayName: 'Run tests in Helix (closed queues)'
condition: ne(variables['System.CollectionUri'],'https://dev.azure.com/ms/')
condition: and(succeeded(),ne(variables['System.CollectionUri'],'https://dev.azure.com/ms/'))
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
HelixAccessToken: $(HelixApiAccessToken)
Expand Down
175 changes: 0 additions & 175 deletions build/Helix/AzurePipelinesHelperScripts.ps1

This file was deleted.

28 changes: 0 additions & 28 deletions build/Helix/ConvertWttLogToXUnit.ps1

This file was deleted.

Loading

0 comments on commit 5b757e8

Please sign in to comment.