-
Notifications
You must be signed in to change notification settings - Fork 818
Expand file tree
/
Copy pathMUX-RunTestsOnPipeline-Job.yml
More file actions
127 lines (110 loc) · 4.53 KB
/
MUX-RunTestsOnPipeline-Job.yml
File metadata and controls
127 lines (110 loc) · 4.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
parameters:
runTestJobName: RunTestsOnPipeline
dependsOn: ''
testSuite: DevTestSuite
rerunPassesRequiredToAvoidFailure: 5
testOS: Win10-22H2
buildPlatform: x86
buildConfiguration: release
parallel: 10
jobs:
- job: ${{ parameters.runTestJobName }}
dependsOn: ${{ parameters.dependsOn }}
condition: not(failed())
pool:
${{ if eq(variables['System.CollectionUri'], 'https://dev.azure.com/shine-oss/') }}:
name: WinDevPoolOSS-Test
${{ if ne(variables['System.CollectionUri'], 'https://dev.azure.com/shine-oss/') }}:
name: WinDevPool-Test
demands: ImageOverride -equals ${{ parameters.testOS }}
timeoutInMinutes: 90
strategy:
parallel: ${{ parameters.parallel }}
variables:
useBuildOutputFromBuildId: $(Build.BuildId)
winuiHelixVersion: 0.5.8
helixScriptPath: $(Build.SourcesDirectory)\build\Helix\packages\Microsoft.Internal.WinUI.Helix.$(winuiHelixVersion)\scripts\pipeline
testSuite: ${{ parameters.testSuite }}
testOS: ${{ parameters.testOS }}
buildPlatform: ${{ parameters.buildPlatform }}
buildConfiguration: ${{ parameters.buildConfiguration }}
buildFlavor: $(buildPlatform)$(buildConfiguration)
workItemsProjNameFilter: '*proj'
workItemsProjDir: $(Build.SourcesDirectory)\TestWorkItems-$(testSuite)\$(buildFlavor)
testPayloadDir: $(Build.SourcesDirectory)\TestPayload-$(testSuite)\$(buildConfiguration)\$(buildPlatform)
uploadRoot: c:\uploadroot
uploadRootInner: $(uploadRoot)\$(testOS)\$(buildFlavor)
testOutputArtifactName: TestOutput-$(testSuite)
testRunTitlePrefix: $(testSuite)-$(testOS)-$(buildFlavor)
testRunTitle: '$(testRunTitlePrefix)-$(System.JobPositionInPhase)'
steps:
- task: PowerShell@2
displayName: 'Display OS version info'
inputs:
targetType: 'inline'
script: |
Get-Item -Path 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion'
- script: set
displayName: 'Display current environment variables'
- template: MUX-InstallNuget-Steps.yml
- 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: DownloadBuildArtifacts@0
inputs:
buildType: specific
buildVersionToDownload: specific
project: $(System.TeamProjectId)
pipeline: $(System.DefinitionId)
buildId: $(useBuildOutputFromBuildId)
artifactName: TestWorkItems-$(testSuite)
downloadPath: $(Build.SourcesDirectory)
- task: DownloadBuildArtifacts@0
inputs:
buildType: specific
buildVersionToDownload: specific
project: $(System.TeamProjectId)
pipeline: $(System.DefinitionId)
buildId: $(useBuildOutputFromBuildId)
artifactName: TestPayload-$(testSuite)
downloadPath: $(Build.SourcesDirectory)
itemPattern: '**/$(buildConfiguration)/$(buildPlatform)/**/*'
- task: powershell@2
displayName: Run Tests
timeoutInMinutes: 60
inputs:
targetType: filePath
filePath: $(helixScriptPath)\RunTestPassSliceOnBuildAgent.ps1
arguments: -WorkItemProjFileNameFilter $(workItemsProjNameFilter) -WorkItemProjDir $(workItemsProjDir) -TestPayloadDir $(testPayloadDir) -UploadRoot $(uploadRootInner) -JobPositionInPhase $(System.JobPositionInPhase) -TotalJobsInPhase $(System.TotalJobsInPhase) -RerunPassesRequiredToAvoidFailure ${{ parameters.rerunPassesRequiredToAvoidFailure }}
errorActionPreference: stop
workingDirectory: $(helixScriptPath)
- task: PublishBuildArtifacts@1
displayName: 'Publish TestOutput artifact'
condition: always()
inputs:
PathtoPublish: $(uploadRoot)
artifactName: $(testOutputArtifactName)
- task: PublishTestResults@2
condition: always()
inputs:
testResultsFormat: xUnit
testResultsFiles: testResults-*.xml
searchFolder: $(helixScriptPath)
mergeTestResults: true
failTaskOnFailedTests: true
testRunTitle: '$(testRunTitle)'
buildPlatform: $(buildPlatform)
buildConfiguration: $(buildConfiguration)
- task: powershell@2
displayName: 'UpdateUnreliableTests.ps1'
condition: always()
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
inputs:
targetType: filePath
filePath: $(helixScriptPath)\UpdateUnreliableTests-Pipeline.ps1
arguments: -RerunPassesRequiredToAvoidFailure ${{ parameters.rerunPassesRequiredToAvoidFailure }} -TestRunTitle $(testRunTitle) -SubResultsDirPath $(uploadRootInner)