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
This commit is contained in:
@@ -297,10 +297,31 @@ stages:
|
|||||||
matrix:
|
matrix:
|
||||||
# Windows:
|
# Windows:
|
||||||
# vmImage: 'windows-latest'
|
# vmImage: 'windows-latest'
|
||||||
Linux:
|
# We split the tests into 3 parts for each OS to reduce the time it takes to run them on the pipeline
|
||||||
|
LinuxPart1Of3:
|
||||||
vmImage: "ubuntu-24.04"
|
vmImage: "ubuntu-24.04"
|
||||||
macOS:
|
# Filter tests that are part of the Umbraco.Infrastructure namespace but not part of the Umbraco.Infrastructure.Service namespace
|
||||||
|
testFilter: '(FullyQualifiedName~Umbraco.Infrastructure) & (FullyQualifiedName!~Umbraco.Infrastructure.Service)'
|
||||||
|
LinuxPart2Of3:
|
||||||
|
vmImage: "ubuntu-24.04"
|
||||||
|
# Filter tests that are part of the Umbraco.Infrastructure.Service namespace
|
||||||
|
testFilter: '(FullyQualifiedName~Umbraco.Infrastructure.Service)'
|
||||||
|
LinuxPart3Of3:
|
||||||
|
vmImage: "ubuntu-24.04"
|
||||||
|
# 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
|
||||||
|
testFilter: '(FullyQualifiedName!~Umbraco.Infrastructure)'
|
||||||
|
macOSPart1Of3:
|
||||||
vmImage: "macOS-latest"
|
vmImage: "macOS-latest"
|
||||||
|
# Filter tests that are part of the Umbraco.Infrastructure namespace but not part of the Umbraco.Infrastructure.Service namespace
|
||||||
|
testFilter: '(FullyQualifiedName~Umbraco.Infrastructure) & (FullyQualifiedName!~Umbraco.Infrastructure.Service)'
|
||||||
|
macOSPart2Of3:
|
||||||
|
vmImage: "macOS-latest"
|
||||||
|
# Filter tests that are part of the Umbraco.Infrastructure.Service namespace
|
||||||
|
testFilter: '(FullyQualifiedName~Umbraco.Infrastructure.Service)'
|
||||||
|
macOSPart3Of3:
|
||||||
|
vmImage: "macOS-latest"
|
||||||
|
# Filter tests that are not part of the Umbraco.Infrastructure namespace.
|
||||||
|
testFilter: '(FullyQualifiedName!~Umbraco.Infrastructure)'
|
||||||
pool:
|
pool:
|
||||||
vmImage: $(vmImage)
|
vmImage: $(vmImage)
|
||||||
variables:
|
variables:
|
||||||
@@ -331,14 +352,13 @@ stages:
|
|||||||
projects: "tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj"
|
projects: "tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj"
|
||||||
testRunTitle: Integration Tests SQLite - $(Agent.OS)
|
testRunTitle: Integration Tests SQLite - $(Agent.OS)
|
||||||
${{ if and(eq(variables['Agent.OS'],'Windows_NT'), or(variables.releaseTestFilter, parameters.forceReleaseTestFilter)) }}:
|
${{ if and(eq(variables['Agent.OS'],'Windows_NT'), or(variables.releaseTestFilter, parameters.forceReleaseTestFilter)) }}:
|
||||||
arguments: "--configuration $(buildConfiguration) --no-build ${{parameters.integrationReleaseTestFilter}}"
|
arguments: '--filter "$(testFilter)" --configuration $(buildConfiguration) --no-build ${{parameters.integrationReleaseTestFilter}}'
|
||||||
${{ elseif eq(variables['Agent.OS'],'Windows_NT') }}:
|
${{ elseif eq(variables['Agent.OS'],'Windows_NT') }}:
|
||||||
arguments: "--configuration $(buildConfiguration) --no-build ${{parameters.integrationNonReleaseTestFilter}}"
|
arguments: '--filter "$(testFilter)" --configuration $(buildConfiguration) --no-build ${{parameters.integrationNonReleaseTestFilter}}'
|
||||||
${{ elseif or(variables.releaseTestFilter, parameters.forceReleaseTestFilter) }}:
|
${{ elseif or(variables.releaseTestFilter, parameters.forceReleaseTestFilter) }}:
|
||||||
arguments: "--configuration $(buildConfiguration) --no-build ${{parameters.nonWindowsIntegrationReleaseTestFilter}}"
|
arguments: '--filter "$(testFilter)" --configuration $(buildConfiguration) --no-build ${{parameters.nonWindowsIntegrationReleaseTestFilter}}'
|
||||||
${{ else }}:
|
${{ else }}:
|
||||||
arguments: "--configuration $(buildConfiguration) --no-build ${{parameters.nonWindowsIntegrationNonReleaseTestFilter}}"
|
arguments: '--filter "$(testFilter)" --configuration $(buildConfiguration) --no-build ${{parameters.nonWindowsIntegrationNonReleaseTestFilter}}'
|
||||||
|
|
||||||
# Integration Tests (SQL Server)
|
# Integration Tests (SQL Server)
|
||||||
- job:
|
- job:
|
||||||
timeoutInMinutes: 180
|
timeoutInMinutes: 180
|
||||||
@@ -347,15 +367,46 @@ stages:
|
|||||||
displayName: Integration Tests (SQL Server)
|
displayName: Integration Tests (SQL Server)
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
Windows:
|
# We split the tests into 3 parts for each OS to reduce the time it takes to run them on the pipeline
|
||||||
|
WindowsPart1Of3:
|
||||||
vmImage: "windows-latest"
|
vmImage: "windows-latest"
|
||||||
Tests__Database__DatabaseType: LocalDb
|
Tests__Database__DatabaseType: LocalDb
|
||||||
Tests__Database__SQLServerMasterConnectionString: N/A
|
Tests__Database__SQLServerMasterConnectionString: N/A
|
||||||
Linux:
|
# Filter tests that are part of the Umbraco.Infrastructure namespace but not part of the Umbraco.Infrastructure.Service namespace
|
||||||
|
testFilter: '(FullyQualifiedName~Umbraco.Infrastructure) & (FullyQualifiedName!~Umbraco.Infrastructure.Service)'
|
||||||
|
WindowsPart2Of3:
|
||||||
|
vmImage: "windows-latest"
|
||||||
|
Tests__Database__DatabaseType: LocalDb
|
||||||
|
Tests__Database__SQLServerMasterConnectionString: N/A
|
||||||
|
# Filter tests that are part of the Umbraco.Infrastructure.Service namespace
|
||||||
|
testFilter: '(FullyQualifiedName~Umbraco.Infrastructure.Service)'
|
||||||
|
WindowsPart3Of3:
|
||||||
|
vmImage: "windows-latest"
|
||||||
|
Tests__Database__DatabaseType: LocalDb
|
||||||
|
Tests__Database__SQLServerMasterConnectionString: N/A
|
||||||
|
# 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
|
||||||
|
testFilter: '(FullyQualifiedName!~Umbraco.Infrastructure)'
|
||||||
|
LinuxPart1Of3:
|
||||||
vmImage: "ubuntu-latest"
|
vmImage: "ubuntu-latest"
|
||||||
SA_PASSWORD: UmbracoIntegration123!
|
SA_PASSWORD: UmbracoIntegration123!
|
||||||
Tests__Database__DatabaseType: SqlServer
|
Tests__Database__DatabaseType: SqlServer
|
||||||
Tests__Database__SQLServerMasterConnectionString: "Server=(local);User Id=sa;Password=$(SA_PASSWORD);TrustServerCertificate=True"
|
Tests__Database__SQLServerMasterConnectionString: "Server=(local);User Id=sa;Password=$(SA_PASSWORD);TrustServerCertificate=True"
|
||||||
|
# Filter tests that are part of the Umbraco.Infrastructure namespace but not part of the Umbraco.Infrastructure.Service namespace
|
||||||
|
testFilter: '(FullyQualifiedName~Umbraco.Infrastructure) & (FullyQualifiedName!~Umbraco.Infrastructure.Service)'
|
||||||
|
LinuxPart2Of3:
|
||||||
|
vmImage: "ubuntu-latest"
|
||||||
|
SA_PASSWORD: UmbracoIntegration123!
|
||||||
|
Tests__Database__DatabaseType: SqlServer
|
||||||
|
Tests__Database__SQLServerMasterConnectionString: "Server=(local);User Id=sa;Password=$(SA_PASSWORD);TrustServerCertificate=True"
|
||||||
|
# Filter tests that are part of the Umbraco.Infrastructure.Service namespace
|
||||||
|
testFilter: '(FullyQualifiedName~Umbraco.Infrastructure.Service)'
|
||||||
|
LinuxPart3Of3:
|
||||||
|
vmImage: "ubuntu-latest"
|
||||||
|
SA_PASSWORD: UmbracoIntegration123!
|
||||||
|
Tests__Database__DatabaseType: SqlServer
|
||||||
|
Tests__Database__SQLServerMasterConnectionString: "Server=(local);User Id=sa;Password=$(SA_PASSWORD);TrustServerCertificate=True"
|
||||||
|
# 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
|
||||||
|
testFilter: '(FullyQualifiedName!~Umbraco.Infrastructure)'
|
||||||
pool:
|
pool:
|
||||||
vmImage: $(vmImage)
|
vmImage: $(vmImage)
|
||||||
steps:
|
steps:
|
||||||
@@ -388,13 +439,13 @@ stages:
|
|||||||
projects: "tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj"
|
projects: "tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj"
|
||||||
testRunTitle: Integration Tests SQL Server - $(Agent.OS)
|
testRunTitle: Integration Tests SQL Server - $(Agent.OS)
|
||||||
${{ if and(eq(variables['Agent.OS'],'Windows_NT'), or(variables.releaseTestFilter, parameters.forceReleaseTestFilter)) }}:
|
${{ if and(eq(variables['Agent.OS'],'Windows_NT'), or(variables.releaseTestFilter, parameters.forceReleaseTestFilter)) }}:
|
||||||
arguments: "--configuration $(buildConfiguration) --no-build ${{parameters.integrationReleaseTestFilter}}"
|
arguments: '--filter "$(testFilter)" --configuration $(buildConfiguration) --no-build ${{parameters.integrationReleaseTestFilter}}'
|
||||||
${{ elseif eq(variables['Agent.OS'],'Windows_NT') }}:
|
${{ elseif eq(variables['Agent.OS'],'Windows_NT') }}:
|
||||||
arguments: "--configuration $(buildConfiguration) --no-build ${{parameters.integrationNonReleaseTestFilter}}"
|
arguments: '--filter "$(testFilter)" --configuration $(buildConfiguration) --no-build ${{parameters.integrationNonReleaseTestFilter}}'
|
||||||
${{ elseif or(variables.releaseTestFilter, parameters.forceReleaseTestFilter) }}:
|
${{ elseif or(variables.releaseTestFilter, parameters.forceReleaseTestFilter) }}:
|
||||||
arguments: "--configuration $(buildConfiguration) --no-build ${{parameters.nonWindowsIntegrationReleaseTestFilter}}"
|
arguments: '--filter "$(testFilter)" --configuration $(buildConfiguration) --no-build ${{parameters.nonWindowsIntegrationReleaseTestFilter}}'
|
||||||
${{ else }}:
|
${{ else }}:
|
||||||
arguments: "--configuration $(buildConfiguration) --no-build ${{parameters.nonWindowsIntegrationNonReleaseTestFilter}}"
|
arguments: '--filter "$(testFilter)" --configuration $(buildConfiguration) --no-build ${{parameters.nonWindowsIntegrationNonReleaseTestFilter}}'
|
||||||
|
|
||||||
# Stop SQL Server
|
# Stop SQL Server
|
||||||
- pwsh: docker stop mssql
|
- pwsh: docker stop mssql
|
||||||
|
|||||||
Reference in New Issue
Block a user