Skip to content

Commit ece803a

Browse files
committed
V15 QA added parallelization for the integration tests (#17713)
* Added parallelization for our integration tests * Updated yaml * Moved filter command to variable definition * Escape quotes * Updated testFilter * Added testFilter for SQlite * Cleaned up filter * Added comments (cherry picked from commit 2f2da48)
1 parent 3cf90ac commit ece803a

File tree

1 file changed

+64
-13
lines changed

1 file changed

+64
-13
lines changed

build/azure-pipelines.yml

Lines changed: 64 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,31 @@ stages:
298298
matrix:
299299
# Windows:
300300
# vmImage: 'windows-latest'
301-
Linux:
301+
# We split the tests into 3 parts for each OS to reduce the time it takes to run them on the pipeline
302+
LinuxPart1Of3:
302303
vmImage: "ubuntu-latest"
303-
macOS:
304+
# Filter tests that are part of the Umbraco.Infrastructure namespace but not part of the Umbraco.Infrastructure.Service namespace
305+
testFilter: '(FullyQualifiedName~Umbraco.Infrastructure) & (FullyQualifiedName!~Umbraco.Infrastructure.Service)'
306+
LinuxPart2Of3:
307+
vmImage: "ubuntu-latest"
308+
# Filter tests that are part of the Umbraco.Infrastructure.Service namespace
309+
testFilter: '(FullyQualifiedName~Umbraco.Infrastructure.Service)'
310+
LinuxPart3Of3:
311+
vmImage: "ubuntu-latest"
312+
# Filter tests that are not part of the Umbraco.Infrastructure namespace. So this will run all tests that are not part of the Umbraco.Infrastructure namespace
313+
testFilter: '(FullyQualifiedName!~Umbraco.Infrastructure)'
314+
macOSPart1Of3:
315+
vmImage: "macOS-latest"
316+
# Filter tests that are part of the Umbraco.Infrastructure namespace but not part of the Umbraco.Infrastructure.Service namespace
317+
testFilter: '(FullyQualifiedName~Umbraco.Infrastructure) & (FullyQualifiedName!~Umbraco.Infrastructure.Service)'
318+
macOSPart2Of3:
304319
vmImage: "macOS-latest"
320+
# Filter tests that are part of the Umbraco.Infrastructure.Service namespace
321+
testFilter: '(FullyQualifiedName~Umbraco.Infrastructure.Service)'
322+
macOSPart3Of3:
323+
vmImage: "macOS-latest"
324+
# Filter tests that are not part of the Umbraco.Infrastructure namespace.
325+
testFilter: '(FullyQualifiedName!~Umbraco.Infrastructure)'
305326
pool:
306327
vmImage: $(vmImage)
307328
variables:
@@ -332,14 +353,13 @@ stages:
332353
projects: "tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj"
333354
testRunTitle: Integration Tests SQLite - $(Agent.OS)
334355
${{ if and(eq(variables['Agent.OS'],'Windows_NT'), or(variables.releaseTestFilter, parameters.forceReleaseTestFilter)) }}:
335-
arguments: "--configuration $(buildConfiguration) --no-build ${{parameters.integrationReleaseTestFilter}}"
356+
arguments: '--filter "$(testFilter)" --configuration $(buildConfiguration) --no-build ${{parameters.integrationReleaseTestFilter}}'
336357
${{ elseif eq(variables['Agent.OS'],'Windows_NT') }}:
337-
arguments: "--configuration $(buildConfiguration) --no-build ${{parameters.integrationNonReleaseTestFilter}}"
358+
arguments: '--filter "$(testFilter)" --configuration $(buildConfiguration) --no-build ${{parameters.integrationNonReleaseTestFilter}}'
338359
${{ elseif or(variables.releaseTestFilter, parameters.forceReleaseTestFilter) }}:
339-
arguments: "--configuration $(buildConfiguration) --no-build ${{parameters.nonWindowsIntegrationReleaseTestFilter}}"
360+
arguments: '--filter "$(testFilter)" --configuration $(buildConfiguration) --no-build ${{parameters.nonWindowsIntegrationReleaseTestFilter}}'
340361
${{ else }}:
341-
arguments: "--configuration $(buildConfiguration) --no-build ${{parameters.nonWindowsIntegrationNonReleaseTestFilter}}"
342-
362+
arguments: '--filter "$(testFilter)" --configuration $(buildConfiguration) --no-build ${{parameters.nonWindowsIntegrationNonReleaseTestFilter}}'
343363
# Integration Tests (SQL Server)
344364
- job:
345365
timeoutInMinutes: 180
@@ -348,15 +368,46 @@ stages:
348368
displayName: Integration Tests (SQL Server)
349369
strategy:
350370
matrix:
351-
Windows:
371+
# We split the tests into 3 parts for each OS to reduce the time it takes to run them on the pipeline
372+
WindowsPart1Of3:
352373
vmImage: "windows-latest"
353374
Tests__Database__DatabaseType: LocalDb
354375
Tests__Database__SQLServerMasterConnectionString: N/A
355-
Linux:
376+
# Filter tests that are part of the Umbraco.Infrastructure namespace but not part of the Umbraco.Infrastructure.Service namespace
377+
testFilter: '(FullyQualifiedName~Umbraco.Infrastructure) & (FullyQualifiedName!~Umbraco.Infrastructure.Service)'
378+
WindowsPart2Of3:
379+
vmImage: "windows-latest"
380+
Tests__Database__DatabaseType: LocalDb
381+
Tests__Database__SQLServerMasterConnectionString: N/A
382+
# Filter tests that are part of the Umbraco.Infrastructure.Service namespace
383+
testFilter: '(FullyQualifiedName~Umbraco.Infrastructure.Service)'
384+
WindowsPart3Of3:
385+
vmImage: "windows-latest"
386+
Tests__Database__DatabaseType: LocalDb
387+
Tests__Database__SQLServerMasterConnectionString: N/A
388+
# Filter tests that are not part of the Umbraco.Infrastructure namespace. So this will run all tests that are not part of the Umbraco.Infrastructure namespace
389+
testFilter: '(FullyQualifiedName!~Umbraco.Infrastructure)'
390+
LinuxPart1Of3:
391+
vmImage: "ubuntu-latest"
392+
SA_PASSWORD: UmbracoIntegration123!
393+
Tests__Database__DatabaseType: SqlServer
394+
Tests__Database__SQLServerMasterConnectionString: "Server=(local);User Id=sa;Password=$(SA_PASSWORD);TrustServerCertificate=True"
395+
# Filter tests that are part of the Umbraco.Infrastructure namespace but not part of the Umbraco.Infrastructure.Service namespace
396+
testFilter: '(FullyQualifiedName~Umbraco.Infrastructure) & (FullyQualifiedName!~Umbraco.Infrastructure.Service)'
397+
LinuxPart2Of3:
398+
vmImage: "ubuntu-latest"
399+
SA_PASSWORD: UmbracoIntegration123!
400+
Tests__Database__DatabaseType: SqlServer
401+
Tests__Database__SQLServerMasterConnectionString: "Server=(local);User Id=sa;Password=$(SA_PASSWORD);TrustServerCertificate=True"
402+
# Filter tests that are part of the Umbraco.Infrastructure.Service namespace
403+
testFilter: '(FullyQualifiedName~Umbraco.Infrastructure.Service)'
404+
LinuxPart3Of3:
356405
vmImage: "ubuntu-latest"
357406
SA_PASSWORD: UmbracoIntegration123!
358407
Tests__Database__DatabaseType: SqlServer
359408
Tests__Database__SQLServerMasterConnectionString: "Server=(local);User Id=sa;Password=$(SA_PASSWORD);TrustServerCertificate=True"
409+
# Filter tests that are not part of the Umbraco.Infrastructure namespace. So this will run all tests that are not part of the Umbraco.Infrastructure namespace
410+
testFilter: '(FullyQualifiedName!~Umbraco.Infrastructure)'
360411
pool:
361412
vmImage: $(vmImage)
362413
steps:
@@ -389,13 +440,13 @@ stages:
389440
projects: "tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj"
390441
testRunTitle: Integration Tests SQL Server - $(Agent.OS)
391442
${{ if and(eq(variables['Agent.OS'],'Windows_NT'), or(variables.releaseTestFilter, parameters.forceReleaseTestFilter)) }}:
392-
arguments: "--configuration $(buildConfiguration) --no-build ${{parameters.integrationReleaseTestFilter}}"
443+
arguments: '--filter "$(testFilter)" --configuration $(buildConfiguration) --no-build ${{parameters.integrationReleaseTestFilter}}'
393444
${{ elseif eq(variables['Agent.OS'],'Windows_NT') }}:
394-
arguments: "--configuration $(buildConfiguration) --no-build ${{parameters.integrationNonReleaseTestFilter}}"
445+
arguments: '--filter "$(testFilter)" --configuration $(buildConfiguration) --no-build ${{parameters.integrationNonReleaseTestFilter}}'
395446
${{ elseif or(variables.releaseTestFilter, parameters.forceReleaseTestFilter) }}:
396-
arguments: "--configuration $(buildConfiguration) --no-build ${{parameters.nonWindowsIntegrationReleaseTestFilter}}"
447+
arguments: '--filter "$(testFilter)" --configuration $(buildConfiguration) --no-build ${{parameters.nonWindowsIntegrationReleaseTestFilter}}'
397448
${{ else }}:
398-
arguments: "--configuration $(buildConfiguration) --no-build ${{parameters.nonWindowsIntegrationNonReleaseTestFilter}}"
449+
arguments: '--filter "$(testFilter)" --configuration $(buildConfiguration) --no-build ${{parameters.nonWindowsIntegrationNonReleaseTestFilter}}'
399450

400451
# Stop SQL Server
401452
- pwsh: docker stop mssql

0 commit comments

Comments
 (0)