forked from hmcts/vh-test-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
258 lines (233 loc) · 9.04 KB
/
azure-pipelines.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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
parameters:
- name: PackageApp
displayName: Package App
type: boolean
default: true
- name: PackageACTests
displayName: Package Acceptance Tests
type: boolean
default: true
- name: RunUnitTests
displayName: Run Unit Tests
type: boolean
default: true
- name: RunIntegTests
displayName: Run Integration Tests
type: boolean
default: false
- name: RunSonarCloudTests
displayName: Run Sonar Cloud Analysis
type: boolean
default: true
- name: RunMutationTests
displayName: Run Mutation Tests
type: boolean
default: true
- name: RunACTests
displayName: Run Acceptance Tests
type: boolean
default: true
- name: RunNodeTests
displayName: Run Node Tests
type: boolean
default: true
- name: testSettings
type: object
default:
# Services
- name: Services:TestApiUrl
value: $(test_api_url)
- name: Services:TestApiResourceId
value: vh-test-api-identifieruris
secret: true
# AzureAd
- name: AzureAd:TenantId
value: tenantid
secret: true
- name: AzureAd:ClientId
value: vh-test-web-appid
secret: true
- name: AzureAd:ClientSecret
value: vh-test-web-key
secret: true
- name: AzureAd:PostLogoutRedirectUri
slot: true
- name: AzureAd:RedirectUri
slot: true
# Testing
- name: Testing:TestUsernameStem
value: $(Testing:TestUsernameStem)
- name: TestUserPassword
value: $(TestUserPassword)
# Ejud
- name: EjudUsernameStem
value: $(EjudUsernameStem)
# Kinly
- name: KinlyConfiguration:CallbackSecret
value: $(CallbackKey)
- name: KinlyConfiguration:ApiSecret
value: $(KinlyApiKey)
# SauceLabs
- name: Saucelabs:Username
value: $(Saucelabs:Username)
- name: Saucelabs:AccessKey
value: $(Saucelabs:AccessKey)
- name: Saucelabs:RealDeviceApiKey
value: $(RealDeviceApiKey)
- name: appSettings
type: object
default:
- name: ApplicationInsights:InstrumentationKey
value: vh-core-infra-AppInsightsKey
secret: true
# AzureAd
- name: AzureAd:ClientId
value: vh-test-web-appid
secret: true
- name: AzureAd:ClientSecret
value: vh-test-web-key
secret: true
- name: AzureAd:PostLogoutRedirectUri
slot:
deployment:
value: $(test_web_url)logout
active:
value: $(test_web_url)logout
- name: AzureAd:RedirectUri
slot:
deployment:
value: $(test_web_url)home
active:
value: $(test_web_url)home
- name: AzureAd:TenantId
value: tenantid
secret: true
# Testing
- name: Testing:TestUsernameStem
value: $(Testing:TestUsernameStem)
- name: TestUserPassword
value: $(TestUserPassword)
# Ejud
- name: EjudUsernameStem
value: $(EjudUsernameStem)
# Kinly
- name: KinlyConfiguration:CallbackSecret
value: $(CallbackKey)
- name: KinlyConfiguration:ApiSecret
value: $(KinlyApiKey)
# Services
- name: Services:TestApiResourceId
value: vh-test-api-identifieruris
secret: true
- name: Services:TestApiUrl
value: $(test_api_url)
# SauceLabs
- name: Saucelabs:Username
value: $(Saucelabs:Username)
- name: Saucelabs:AccessKey
value: $(Saucelabs:AccessKey)
- name: Saucelabs:RealDeviceApiKey
value: $(RealDeviceApiKey)
variables:
- group: vh-domains-and-urls
- group: vh-apps-settings-generic
- group: vh-test-web
- group: vh-preview
- group: Saucelabs
- group: KinlyConfiguration_Test
trigger:
branches:
include:
- master
- release/*
- hotfix/*
pr:
branches:
include:
- master
resources:
repositories:
- repository: templates
type: github
name: hmcts/azure-devops-templates
ref: refs/heads/master
endpoint: hmcts_shaed
containers:
- container: dotnetsdk
image: sspublicsbox.azurecr.io/vh/dotnet-angular:3.1.102
endpoint: sspublicsbox
- container: dotnetsdk-cipipeline
image: sspublicsbox.azurecr.io/vh/dotnet-angular-cipipeline:3.1.102
endpoint: sspublicsbox
- container: node
image: node:lts-alpine
extends:
template: stages\dotnet-package.yml@templates
parameters:
coreProjectPath: TestWeb/TestWeb
nodeProjectPath: TestWeb/TestWeb/ClientApp
PackageApp: ${{ parameters.PackageApp }}
PackageAcceptanceTests: ${{ parameters.PackageACTests }}
packageManagers:
- nuget
- npm
Test: ${{ or(parameters.RunUnitTests, parameters.RunIntegTests, parameters.RunMutationTests) }}
testParameters:
coreProjectPath: TestWeb/TestWeb
nodeProjectPath: TestWeb/TestWeb/ClientApp
RunNode: true
unitTestProjectPath: TestWeb/TestWeb.UnitTests
integTestProjectPath: TestWeb/TestWeb.IntegrationTests
secrets_KeyVault: $(pr_Secret_KeyVault)
secrets_Subscription: $(pr_Secret_Subscription)
RunUnitTests: ${{ parameters.RunUnitTests }}
RunIntegrationTests: ${{ parameters.RunIntegTests }}
RunSonarCloud: ${{ parameters.RunSonarCloudTests }}
RunStryker: ${{ parameters.RunMutationTests }}
IntegrationTestSettings:
- ${{ each setting in parameters.testSettings }}:
- name: ${{ setting.name }}
value: ${{ setting.value }}
secret: ${{ setting.secret }}
coverletCoverageExclusions:
- '[TestWeb]TestWeb.ConfigureServicesExtensions'
- '[TestWeb]TestWeb.Program'
- '[TestWeb]TestWeb.Startup'
- '[*]TestWeb.Common.*'
- '[*]TestWeb.Extensions.*'
- '[*]TestWeb.Pages.*'
- '[*]TestWeb.Swagger.*'
- '[*]TestWeb.Views.*'
- '[*]TestWeb.UnitTests.*'
- '[*]TestWeb.Services.*'
- '[*]Testing.Common.*'
sonarCloud_ExtraProperties: |
sonar.exclusions=**/node_modules/**,**/*.spec.ts, *.spec.ts, **/ClientApp/src/*, **/ClientApp/coverage/**/**, **/ConfigureServicesExtensions.cs, **/Startup.cs, **/Program.cs, **/TestWeb.Tests.Common/**, **/TestWeb.UnitTests/**, **/TestWeb.IntegrationTests/**, **/TestWeb.AcceptanceTests/**, **/TestWeb.Common/**, **/TestWeb/Pages/**, **/TestWeb/Swagger/**, **/TestWeb/Program/**, **/TestWeb/Extensions/**, **/ClientApp/src/scripts/*.js
sonar.typescript.exclusions=**/node_modules/**,**/typings.d.ts,**/main.ts,**/environments/environment*.ts,**/*routing.module.ts,**/api-client.ts
sonar.coverage.exclusions= **/TestWeb.Tests.Common/**, TestWeb/Views/*, TestWeb/Pages/*, TestWeb/Program/*, TestWeb/Swagger/*, TestWeb.UnitTests/*, TestWeb.IntegrationTests/*, TestWeb.AcceptanceTests/*, **/TestWeb.Services/**, **/ClientApp/src/scripts/*.js, **/ClientApp/src/app/testing/**
sonar.cs.opencover.reportsPaths=$(Common.TestResultsDirectory)/Coverage/coverage.opencover.xml
sonar.typescript.lcov.reportPaths=$(System.DefaultWorkingDirectory)/TestWeb/TestWeb/ClientApp/coverage/lcov.info
StrykerBreak: 75
ACTest: ${{ parameters.RunACTests }}
releaseParameters:
environment: Preview
subscription: $(pr_Subscription)
secrets_KeyVault: $(pr_Secret_KeyVault)
secrets_Subscription: $(pr_Secret_Subscription)
devOpsResource: vh_test_web
deploymentSlot: production
appName: vh-test-web-$(environment)
resourceGroup: vh-test-web-$(environment)
appSettings: ${{ parameters.appSettings }}
testCaseFilter: TestCategory=smoketest
dependentApps:
- name: vh-test-api-$(environment)
resourceGroup: vh-test-api-$(environment)
healthEndpoint: $(test_api_url)health/health
acceptanceTestSettings:
- name: Services:TestWebUrl
value: $(test_web_url)
- ${{ each setting in parameters.testSettings }}:
- name: ${{ setting.name }}
value: ${{ setting.value }}
secret: ${{ setting.secret }}