Skip to content

Commit 61766f0

Browse files
committed
Introduce CI redundancy groups
1 parent e87c07b commit 61766f0

3 files changed

Lines changed: 345 additions & 10 deletions

File tree

azure-pipelines-internal-tests.yml

Lines changed: 174 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ extends:
9797
jobs:
9898
- template: /eng/common/templates-official/jobs/jobs.yml@self
9999
parameters:
100+
continueOnError: true
100101
enableMicrobuild: true
101102
enablePublishBuildArtifacts: true
102103
enablePublishBuildAssets: false
@@ -129,14 +130,31 @@ extends:
129130
- script: "echo ##vso[build.addbuildtag]release-candidate"
130131
condition: and(notin(variables['Build.Reason'], 'PullRequest'), eq(variables['IsFinalBuild'], 'true'))
131132
displayName: 'Set CI tags'
132-
- powershell: SqlLocalDB start
133-
displayName: Start LocalDB
134133
- template: /eng/common/templates-official/steps/enable-internal-sources.yml
135134
- template: /eng/common/templates-official/steps/enable-internal-runtimes.yml
136135
- script: eng\common\cibuild.cmd -configuration $(_BuildConfig) -prepareMachine $(_InternalBuildArgs) $(_InternalRuntimeDownloadArgs)
137136
env:
138137
Test__Cosmos__DefaultConnection: $(_CosmosConnectionUrl)
139138
displayName: Build
139+
140+
- job: Windows_SqlServer
141+
displayName: 'Windows SQL Server'
142+
pool:
143+
name: $(DncEngInternalBuildPool)
144+
demands: ImageOverride -equals 1es-windows-2022
145+
os: windows
146+
timeoutInMinutes: 120
147+
variables:
148+
- skipComponentGovernanceDetection: true
149+
steps:
150+
- powershell: SqlLocalDB start
151+
displayName: Start LocalDB
152+
- template: /eng/common/templates-official/steps/enable-internal-sources.yml
153+
- template: /eng/common/templates-official/steps/enable-internal-runtimes.yml
154+
- script: eng\common\build.cmd -restore -build -test -ci -configuration $(_BuildConfig) -prepareMachine $(_InternalRuntimeDownloadArgs)
155+
/p:Projects="$(Build.SourcesDirectory)/test/EFCore.SqlServer.FunctionalTests/EFCore.SqlServer.FunctionalTests.csproj;$(Build.SourcesDirectory)/test/EFCore.SqlServer.HierarchyId.Tests/EFCore.SqlServer.HierarchyId.Tests.csproj;$(Build.SourcesDirectory)/test/EFCore.CrossStore.FunctionalTests/EFCore.CrossStore.FunctionalTests.csproj;$(Build.SourcesDirectory)/test/EFCore.OData.FunctionalTests/EFCore.OData.FunctionalTests.csproj;$(Build.SourcesDirectory)/test/EFCore.AspNet.SqlServer.FunctionalTests/EFCore.AspNet.SqlServer.FunctionalTests.csproj;$(Build.SourcesDirectory)/test/EFCore.VisualBasic.FunctionalTests/EFCore.VisualBasic.FunctionalTests.vbproj;$(Build.SourcesDirectory)/test/EFCore.FSharp.FunctionalTests/EFCore.FSharp.FunctionalTests.fsproj"
156+
displayName: Test SQL Server
157+
140158
- job: macOS
141159
pool:
142160
name: Azure Pipelines
@@ -174,6 +192,7 @@ extends:
174192
sdl:
175193
binskim:
176194
preReleaseVersion: ''
195+
177196
- job: Linux_Cosmos
178197
displayName: 'Linux Cosmos'
179198
condition: notin(variables['Build.Reason'], 'PullRequest', 'Schedule')
@@ -218,6 +237,7 @@ extends:
218237
sdl:
219238
binskim:
220239
preReleaseVersion: ''
240+
221241
- job: Helix_Windows
222242
displayName: 'Helix Windows'
223243
timeoutInMinutes: 180
@@ -260,6 +280,90 @@ extends:
260280
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
261281
DotNetBuildsInternalReadSasToken: $(dotnetbuilds-internal-container-read-token)
262282

283+
- job: Helix_Windows_SqlServer
284+
displayName: 'Helix Windows SQL Server'
285+
timeoutInMinutes: 180
286+
pool:
287+
name: $(DncEngInternalBuildPool)
288+
demands: ImageOverride -equals 1es-windows-2022
289+
os: windows
290+
variables:
291+
- skipComponentGovernanceDetection: true
292+
- name: _HelixBuildConfig
293+
value: $(_BuildConfig)
294+
- name: HelixTargetQueues
295+
value: Windows.11.Amd64.Client
296+
- name: _HelixAccessToken
297+
value: $(HelixApiAccessToken)
298+
steps:
299+
- task: NuGetCommand@2
300+
displayName: 'Clear NuGet caches'
301+
condition: succeeded()
302+
inputs:
303+
command: custom
304+
arguments: 'locals all -clear'
305+
- template: /eng/common/templates-official/steps/enable-internal-sources.yml
306+
- template: /eng/common/templates-official/steps/enable-internal-runtimes.yml
307+
- template: /eng/common/core-templates/steps/get-delegation-sas.yml
308+
parameters:
309+
federatedServiceConnection: 'dotnetbuilds-internal-read'
310+
outputVariableName: 'dotnetbuilds-internal-container-read-token'
311+
expiryInHours: 3
312+
base64Encode: false
313+
storageAccount: dotnetbuilds
314+
container: internal
315+
permissions: rl
316+
- script: restore.cmd -ci /p:configuration=$(_BuildConfig) $(_InternalRuntimeDownloadArgs)
317+
displayName: Restore packages
318+
- script: .dotnet\dotnet build eng\helix.proj /restore /t:Test /p:configuration=$(_BuildConfig) /bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/SendToHelix.binlog $(_InternalRuntimeDownloadArgs)
319+
displayName: Send tests to helix
320+
env:
321+
HelixAccessToken: $(_HelixAccessToken)
322+
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
323+
DotNetBuildsInternalReadSasToken: $(dotnetbuilds-internal-container-read-token)
324+
325+
- job: Helix_Windows_Arm64
326+
displayName: 'Helix Windows ARM64'
327+
timeoutInMinutes: 180
328+
pool:
329+
name: $(DncEngInternalBuildPool)
330+
demands: ImageOverride -equals 1es-windows-2022
331+
os: windows
332+
variables:
333+
- skipComponentGovernanceDetection: true
334+
- name: _HelixBuildConfig
335+
value: $(_BuildConfig)
336+
- name: HelixTargetQueues
337+
value: Windows.11.Arm64
338+
- name: _HelixAccessToken
339+
value: $(HelixApiAccessToken)
340+
steps:
341+
- task: NuGetCommand@2
342+
displayName: 'Clear NuGet caches'
343+
condition: succeeded()
344+
inputs:
345+
command: custom
346+
arguments: 'locals all -clear'
347+
- template: /eng/common/templates-official/steps/enable-internal-sources.yml
348+
- template: /eng/common/templates-official/steps/enable-internal-runtimes.yml
349+
- template: /eng/common/core-templates/steps/get-delegation-sas.yml
350+
parameters:
351+
federatedServiceConnection: 'dotnetbuilds-internal-read'
352+
outputVariableName: 'dotnetbuilds-internal-container-read-token'
353+
expiryInHours: 3
354+
base64Encode: false
355+
storageAccount: dotnetbuilds
356+
container: internal
357+
permissions: rl
358+
- script: restore.cmd -ci /p:configuration=$(_BuildConfig) $(_InternalRuntimeDownloadArgs)
359+
displayName: Restore packages
360+
- script: .dotnet\dotnet build eng\helix.proj /restore /t:Test /p:configuration=$(_BuildConfig) /bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/SendToHelix.binlog $(_InternalRuntimeDownloadArgs)
361+
displayName: Send tests to helix
362+
env:
363+
HelixAccessToken: $(_HelixAccessToken)
364+
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
365+
DotNetBuildsInternalReadSasToken: $(dotnetbuilds-internal-container-read-token)
366+
263367
- job: Helix_macOS_x64
264368
displayName: 'Helix macOS x64'
265369
timeoutInMinutes: 180
@@ -470,3 +574,71 @@ extends:
470574
HelixAccessToken: $(_HelixAccessToken)
471575
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
472576
DotNetBuildsInternalReadSasToken: $(dotnetbuilds-internal-container-read-token)
577+
- stage: validate
578+
displayName: Validate
579+
dependsOn: build
580+
condition: always()
581+
jobs:
582+
- job: Validate_Job_Results
583+
displayName: Validate Job Results
584+
pool:
585+
name: $(DncEngInternalBuildPool)
586+
demands: ImageOverride -equals 1es-windows-2022
587+
os: windows
588+
variables:
589+
WindowsResult: $[ stageDependencies.build.Windows.result ]
590+
HelixWindowsResult: $[ stageDependencies.build.Helix_Windows.result ]
591+
WindowsSqlServerResult: $[ stageDependencies.build.Windows_SqlServer.result ]
592+
HelixWindowsSqlServerResult: $[ stageDependencies.build.Helix_Windows_SqlServer.result ]
593+
LinuxResult: $[ stageDependencies.build.Linux.result ]
594+
HelixUbuntuResult: $[ stageDependencies.build.Helix_Ubuntu.result ]
595+
HelixUbuntuSqlServerResult: $[ stageDependencies.build.Helix_Ubuntu_SqlServer.result ]
596+
MacOsResult: $[ stageDependencies.build.macOS.result ]
597+
HelixMacOsX64Result: $[ stageDependencies.build.Helix_macOS_x64.result ]
598+
HelixMacOsArm64Result: $[ stageDependencies.build.Helix_macOS_ARM64.result ]
599+
HelixWindowsArm64Result: $[ stageDependencies.build.Helix_Windows_Arm64.result ]
600+
LinuxCosmosResult: $[ stageDependencies.build.Linux_Cosmos.result ]
601+
HelixUbuntuCosmosResult: $[ stageDependencies.build.Helix_Ubuntu_Cosmos.result ]
602+
steps:
603+
- pwsh: |
604+
$groupResults = @{
605+
Windows = @("$(WindowsResult)", "$(HelixWindowsResult)")
606+
Linux = @("$(LinuxResult)", "$(HelixUbuntuResult)")
607+
MacOS = @("$(MacOsResult)", "$(HelixMacOsX64Result)")
608+
Arm64 = @("$(HelixWindowsArm64Result)", "$(HelixMacOsArm64Result)")
609+
Cosmos = @("$(LinuxCosmosResult)", "$(HelixUbuntuCosmosResult)")
610+
SqlServer = @("$(WindowsSqlServerResult)", "$(HelixWindowsSqlServerResult)", "$(HelixUbuntuSqlServerResult)")
611+
}
612+
613+
$failedGroups = @()
614+
615+
foreach ($groupName in $groupResults.Keys)
616+
{
617+
$results = $groupResults[$groupName]
618+
Write-Host "$groupName results: $($results -join ', ')"
619+
620+
# Ignore jobs that were skipped (e.g. condition-gated)
621+
$ran = $results | Where-Object { $_ -ne 'Skipped' }
622+
if (-not $ran)
623+
{
624+
Write-Host " -> all jobs skipped, treating group as successful"
625+
continue
626+
}
627+
628+
$hasSuccess = $ran | Where-Object { $_ -eq 'Succeeded' }
629+
if ($hasSuccess)
630+
{
631+
continue
632+
}
633+
634+
$failedGroups += $groupName
635+
}
636+
637+
if ($failedGroups.Count -gt 0)
638+
{
639+
Write-Error "No jobs succeeded for group(s): $($failedGroups -join ', ')."
640+
exit 1
641+
}
642+
643+
Write-Host 'Group validation passed.'
644+
displayName: Evaluate grouped job outcomes

azure-pipelines-public.yml

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ stages:
4040
jobs:
4141
- template: eng/common/templates/jobs/jobs.yml
4242
parameters:
43+
continueOnError: true
4344
enableMicrobuild: true
4445
enablePublishBuildArtifacts: true
4546
enablePublishBuildAssets: true
@@ -91,6 +92,32 @@ stages:
9192
artifactType: Container
9293
parallel: true
9394

95+
- job: Windows_SqlServer
96+
displayName: 'Windows SQL Server'
97+
enablePublishTestResults: true
98+
pool:
99+
name: $(DncEngPublicBuildPool)
100+
demands: ImageOverride -equals 1es-windows-2022-open
101+
timeoutInMinutes: 120
102+
variables:
103+
- skipComponentGovernanceDetection: true
104+
- Codeql.SkipTaskAutoInjection: true
105+
steps:
106+
- powershell: SqlLocalDB start
107+
displayName: Start LocalDB
108+
- script: eng\common\build.cmd -restore -build -test -ci -configuration $(_BuildConfig) -prepareMachine $(_InternalRuntimeDownloadArgs)
109+
/p:Projects="$(Build.SourcesDirectory)/test/EFCore.SqlServer.FunctionalTests/EFCore.SqlServer.FunctionalTests.csproj;$(Build.SourcesDirectory)/test/EFCore.SqlServer.HierarchyId.Tests/EFCore.SqlServer.HierarchyId.Tests.csproj;$(Build.SourcesDirectory)/test/EFCore.CrossStore.FunctionalTests/EFCore.CrossStore.FunctionalTests.csproj;$(Build.SourcesDirectory)/test/EFCore.OData.FunctionalTests/EFCore.OData.FunctionalTests.csproj;$(Build.SourcesDirectory)/test/EFCore.AspNet.SqlServer.FunctionalTests/EFCore.AspNet.SqlServer.FunctionalTests.csproj;$(Build.SourcesDirectory)/test/EFCore.VisualBasic.FunctionalTests/EFCore.VisualBasic.FunctionalTests.vbproj;$(Build.SourcesDirectory)/test/EFCore.FSharp.FunctionalTests/EFCore.FSharp.FunctionalTests.fsproj"
110+
displayName: Test SQL Server
111+
- task: PublishBuildArtifacts@1
112+
displayName: Upload TestResults
113+
condition: always()
114+
continueOnError: true
115+
inputs:
116+
pathtoPublish: artifacts/TestResults/$(_BuildConfig)/
117+
artifactName: $(Agent.Os)_$(Agent.JobName) TestResults
118+
artifactType: Container
119+
parallel: true
120+
94121
- job: macOS
95122
enablePublishTestResults: true
96123
pool:
@@ -170,6 +197,66 @@ stages:
170197
HelixAccessToken: $(_HelixAccessToken)
171198
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
172199

200+
- job: Helix_Windows_SqlServer
201+
displayName: 'Helix Windows SQL Server'
202+
timeoutInMinutes: 180
203+
pool:
204+
name: $(DncEngPublicBuildPool)
205+
demands: ImageOverride -equals 1es-windows-2022-open
206+
variables:
207+
- skipComponentGovernanceDetection: true
208+
- Codeql.SkipTaskAutoInjection: true
209+
- name: _HelixBuildConfig
210+
value: $(_BuildConfig)
211+
- name: HelixTargetQueues
212+
value: Windows.11.Amd64.Client.Open
213+
- name: _HelixAccessToken
214+
value: ''
215+
steps:
216+
- task: NuGetCommand@2
217+
displayName: 'Clear NuGet caches'
218+
condition: succeeded()
219+
inputs:
220+
command: custom
221+
arguments: 'locals all -clear'
222+
- script: restore.cmd -ci /p:configuration=$(_BuildConfig) $(_InternalRuntimeDownloadArgs)
223+
displayName: Restore packages
224+
- script: .dotnet\dotnet build eng\helix.proj /restore /t:Test /p:configuration=$(_BuildConfig) /bl:artifacts/log/$(_BuildConfig)/SendToHelix.binlog $(_InternalRuntimeDownloadArgs)
225+
displayName: Send tests to helix
226+
env:
227+
HelixAccessToken: $(_HelixAccessToken)
228+
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
229+
230+
- job: Helix_Windows_Arm64
231+
displayName: 'Helix Windows ARM64'
232+
timeoutInMinutes: 180
233+
pool:
234+
name: $(DncEngPublicBuildPool)
235+
demands: ImageOverride -equals 1es-windows-2022-open
236+
variables:
237+
- skipComponentGovernanceDetection: true
238+
- Codeql.SkipTaskAutoInjection: true
239+
- name: _HelixBuildConfig
240+
value: $(_BuildConfig)
241+
- name: HelixTargetQueues
242+
value: Windows.11.Arm64.Open
243+
- name: _HelixAccessToken
244+
value: ''
245+
steps:
246+
- task: NuGetCommand@2
247+
displayName: 'Clear NuGet caches'
248+
condition: succeeded()
249+
inputs:
250+
command: custom
251+
arguments: 'locals all -clear'
252+
- script: restore.cmd -ci /p:configuration=$(_BuildConfig) $(_InternalRuntimeDownloadArgs)
253+
displayName: Restore packages
254+
- script: .dotnet\dotnet build eng\helix.proj /restore /t:Test /p:configuration=$(_BuildConfig) /bl:artifacts/log/$(_BuildConfig)/SendToHelix.binlog $(_InternalRuntimeDownloadArgs)
255+
displayName: Send tests to helix
256+
env:
257+
HelixAccessToken: $(_HelixAccessToken)
258+
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
259+
173260
- job: Helix_macOS_x64
174261
displayName: 'Helix macOS x64'
175262
timeoutInMinutes: 180
@@ -320,3 +407,69 @@ stages:
320407
env:
321408
HelixAccessToken: $(_HelixAccessToken)
322409
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
410+
- stage: validate
411+
displayName: Validate
412+
dependsOn: build
413+
condition: always()
414+
jobs:
415+
- job: Validate_Job_Results
416+
displayName: Validate Job Results
417+
pool:
418+
name: $(DncEngPublicBuildPool)
419+
demands: ImageOverride -equals 1es-windows-2022-open
420+
variables:
421+
WindowsResult: $[ stageDependencies.build.Windows.result ]
422+
HelixWindowsResult: $[ stageDependencies.build.Helix_Windows.result ]
423+
WindowsSqlServerResult: $[ stageDependencies.build.Windows_SqlServer.result ]
424+
HelixWindowsSqlServerResult: $[ stageDependencies.build.Helix_Windows_SqlServer.result ]
425+
LinuxResult: $[ stageDependencies.build.Linux.result ]
426+
HelixUbuntuResult: $[ stageDependencies.build.Helix_Ubuntu.result ]
427+
HelixUbuntuSqlServerResult: $[ stageDependencies.build.Helix_Ubuntu_SqlServer.result ]
428+
MacOsResult: $[ stageDependencies.build.macOS.result ]
429+
HelixMacOsX64Result: $[ stageDependencies.build.Helix_macOS_x64.result ]
430+
HelixMacOsArm64Result: $[ stageDependencies.build.Helix_macOS_ARM64.result ]
431+
HelixWindowsArm64Result: $[ stageDependencies.build.Helix_Windows_Arm64.result ]
432+
HelixUbuntuCosmosResult: $[ stageDependencies.build.Helix_Ubuntu_Cosmos.result ]
433+
steps:
434+
- pwsh: |
435+
$groupResults = @{
436+
Windows = @("$(WindowsResult)", "$(HelixWindowsResult)")
437+
Linux = @("$(LinuxResult)", "$(HelixUbuntuResult)")
438+
MacOS = @("$(MacOsResult)", "$(HelixMacOsX64Result)")
439+
Arm64 = @("$(HelixWindowsArm64Result)", "$(HelixMacOsArm64Result)")
440+
Cosmos = @("$(HelixUbuntuCosmosResult)")
441+
SqlServer = @("$(WindowsSqlServerResult)", "$(HelixWindowsSqlServerResult)", "$(HelixUbuntuSqlServerResult)")
442+
}
443+
444+
$failedGroups = @()
445+
446+
foreach ($groupName in $groupResults.Keys)
447+
{
448+
$results = $groupResults[$groupName]
449+
Write-Host "$groupName results: $($results -join ', ')"
450+
451+
# Ignore jobs that were skipped (e.g. condition-gated)
452+
$ran = $results | Where-Object { $_ -ne 'Skipped' }
453+
if (-not $ran)
454+
{
455+
Write-Host " -> all jobs skipped, treating group as successful"
456+
continue
457+
}
458+
459+
$hasSuccess = $ran | Where-Object { $_ -eq 'Succeeded' }
460+
if ($hasSuccess)
461+
{
462+
continue
463+
}
464+
465+
$failedGroups += $groupName
466+
}
467+
468+
if ($failedGroups.Count -gt 0)
469+
{
470+
Write-Error "No jobs succeeded for group(s): $($failedGroups -join ', ')."
471+
exit 1
472+
}
473+
474+
Write-Host 'Group validation passed.'
475+
displayName: Evaluate grouped job outcomes

0 commit comments

Comments
 (0)