forked from unoplatform/uno
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.azure-devops-wasm-uitests.yml
191 lines (151 loc) · 5.5 KB
/
.azure-devops-wasm-uitests.yml
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
parameters:
pool: ''
jobs:
- job: Wasm_UITests_Build
container: nv-bionic-wasm
pool:
vmImage: 'ubuntu-16.04'
variables:
NUGET_PACKAGES: $(build.sourcesdirectory)/.nuget
steps:
- checkout: self
clean: true
- bash: |
source /emsdk/emsdk_env.sh
msbuild /r /p:Configuration=Release src/SamplesApp/SamplesApp.Wasm/SamplesApp.Wasm.csproj /p:UnoSourceGeneratorUseGenerationHost=true /p:UnoSourceGeneratorUseGenerationController=false
msbuild /r /p:Configuration=Release src/SamplesApp/SamplesApp.UITests/SamplesApp.UITests.csproj
displayName: 'Build sample app'
- task: CopyFiles@2
displayName: 'Publish Wasm Site'
inputs:
SourceFolder: $(build.sourcesdirectory)/src/SamplesApp/SamplesApp.Wasm/bin/Release/netstandard2.0/dist
Contents: '**/*.*'
TargetFolder: $(build.artifactstagingdirectory)/site
CleanTargetFolder: false
OverWrite: false
flattenFolders: false
- task: CopyFiles@2
displayName: 'Publish Wasm UITest binaries'
inputs:
SourceFolder: $(build.sourcesdirectory)/src/SamplesApp/SamplesApp.UITests/bin/Release/net47
Contents: '**/*.*'
TargetFolder: $(build.artifactstagingdirectory)/test-bin
CleanTargetFolder: false
OverWrite: false
flattenFolders: false
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(build.artifactstagingdirectory)
ArtifactName: wasm-uitest-binaries
ArtifactType: Container
- job: Wasm_UITests_Snap
dependsOn: Wasm_UITests_Build
container: nv-bionic-wasm
pool:
vmImage: 'ubuntu-16.04'
variables:
NUGET_PACKAGES: $(build.sourcesdirectory)/.nuget
steps:
- checkout: self
clean: true
- task: DownloadBuildArtifacts@0
inputs:
artifactName: wasm-uitest-binaries
downloadPath: '$(build.sourcesdirectory)/build'
- bash: |
cd $(build.sourcesdirectory)/build/wasm-uitest-binaries/site
python server.py &
cd $(build.sourcesdirectory)/src/SamplesApp/SamplesApp.Wasm.UITests
npm install
node app
displayName: 'Running UI Tests'
- task: CopyFiles@2
displayName: 'Publish Wasm Tests results'
inputs:
SourceFolder: $(build.sourcesdirectory)/src/SamplesApp/SamplesApp.Wasm.UITests/out
Contents: '**/*.*'
TargetFolder: $(build.artifactstagingdirectory)/screenshots/wasm
CleanTargetFolder: false
OverWrite: false
flattenFolders: false
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(build.artifactstagingdirectory)
ArtifactName: uitests-results
ArtifactType: Container
- job: Wasm_UITests_Automated
dependsOn: Wasm_UITests_Build
container: nv-bionic-wasm
pool:
vmImage: 'ubuntu-16.04'
variables:
NUGET_PACKAGES: $(build.sourcesdirectory)/.nuget
steps:
- checkout: self
clean: true
- task: DownloadBuildArtifacts@0
inputs:
artifactName: wasm-uitest-binaries
downloadPath: '$(build.sourcesdirectory)/build'
- bash: |
chmod +x $(build.sourcesdirectory)/build/run-automated-uitests.sh
$(build.sourcesdirectory)/build/run-automated-uitests.sh
env:
BUILD_SOURCESDIRECTORY: "$(build.sourcesdirectory)"
BUILD_ARTIFACTSTAGINGDIRECTORY: "$(build.artifactstagingdirectory)"
displayName: 'Running UI Tests'
- task: PublishTestResults@2
condition: always()
inputs:
testResultsFiles: '$(build.sourcesdirectory)/build/wasm-uitest-binaries/TestResult.xml'
testRunTitle: 'WebAssembly Test Run'
testResultsFormat: 'NUnit'
failTaskOnFailedTests: true
- task: PublishBuildArtifacts@1
condition: always()
inputs:
PathtoPublish: $(build.artifactstagingdirectory)
ArtifactName: uitests-results
ArtifactType: Container
- job: Wasm_UITests_Compare
dependsOn: Wasm_UITests_Snap
pool:
vmImage: 'vs2017-win2016'
steps:
- checkout: self
clean: true
- task: NuGetToolInstaller@0
inputs:
versionSpec: 4.9.1
checkLatest: false
- task: MSBuild@1
inputs:
solution: src/Uno.UI.TestComparer/Uno.UI.TestComparer.csproj
msbuildLocationMethod: version
msbuildVersion: latest
msbuildArchitecture: x86
msbuildArguments: /r "/p:Configuration=Release"
clean: false
maximumCpuCount: true
restoreNugetPackages: false
logProjectEvents: false
createLogFile: false
- script: |
src\Uno.UI.TestComparer\bin\Release\net461\Uno.UI.TestComparer.exe "azdo" --pat="$(UITestsCompare_PAT)" --base-path="$(build.artifactstagingdirectory)" --source-branch="%GIT_SOURCEBRANCH%" --target-branch="%GIT_TARGETBRANCH%" --artifact-name="uitests-results" --artifact-inner-path="uitests-results\screenshots" --definition-name="$(Build.DefinitionName)" --project-name="$(System.TeamProject)" --server-uri="$(System.TeamFoundationCollectionUri)" --current-build="$(Build.BuildId)" --run-limit="3"
env:
GIT_TARGETBRANCH: "$(System.PullRequest.TargetBranch)"
GIT_SOURCEBRANCH: "$(Build.SourceBranch)"
displayName: 'Compare UI Tests screenshots'
condition: eq(variables['Build.Repository.Provider'], 'GitHub')
- task: PublishTestResults@2
condition: always()
inputs:
testResultsFiles: '$(build.artifactstagingdirectory)\*.xml'
testRunTitle: 'Screenshots Compare Test Run'
testResultsFormat: 'NUnit'
failTaskOnFailedTests: false
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(build.artifactstagingdirectory)
ArtifactName: wasm-uitests-compare-results
ArtifactType: Container