2024-09-16 10:13:26 +02:00
name : Nightly_E2E_Test_$(TeamProject)_$(Build.DefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
pr : none
trigger : none
schedules :
2024-09-25 07:04:12 +02:00
- cron : '0 0 * * *'
displayName : Daily midnight build
branches :
include :
- v15/dev
2025-11-04 08:23:04 +01:00
- v16/dev
2025-05-07 15:09:28 +07:00
- main
2024-09-16 10:13:26 +02:00
2025-05-20 11:31:14 +07:00
parameters :
2025-09-18 10:58:54 +02:00
- name : skipIntegrationTests
displayName : Skip integration tests
type : boolean
default : false
2025-11-05 15:54:09 +07:00
- name : skipDifferentAppSettingsAcceptanceTests
displayName : Skip acceptance tests with different app settings
2025-09-18 10:58:54 +02:00
type : boolean
2025-11-05 15:54:09 +07:00
default : false
2025-09-18 10:58:54 +02:00
- name : skipDefaultConfigAcceptanceTests
displayName : Skip tests with DefaultConfig
2025-05-20 11:31:14 +07:00
type : boolean
default : false
2024-09-16 10:13:26 +02:00
variables :
nodeVersion : 20
solution : umbraco.sln
buildConfiguration : Release
UMBRACO__CMS__GLOBAL__ID : 00000000 -0000 -0000 -0000 -000000000042
DOTNET_NOLOGO : true
DOTNET_GENERATE_ASPNET_CERTIFICATE : false
DOTNET_SKIP_FIRST_TIME_EXPERIENCE : true
DOTNET_CLI_TELEMETRY_OPTOUT : true
npm_config_cache : $(Pipeline.Workspace)/.npm_client
NODE_OPTIONS : --max_old_space_size=16384
stages :
###############################################
## Build
###############################################
- stage : Build
jobs :
- job : A
displayName : Build Umbraco CMS
pool :
2025-05-05 17:13:50 +07:00
vmImage : "windows-latest"
2024-09-16 10:13:26 +02:00
steps :
- checkout : self
2025-05-05 17:13:50 +07:00
submodules : false
lfs : false ,
fetchDepth : 500
- template : templates/backoffice-install.yml
2024-09-16 10:13:26 +02:00
- task : UseDotNet@2
displayName : Use .NET SDK from global.json
inputs :
useGlobalJson : true
- task : DotNetCoreCLI@2
displayName : Run dotnet restore
inputs :
command : restore
projects : $(solution)
- task : DotNetCoreCLI@2
name : build
displayName : Run dotnet build and generate NuGet packages
inputs :
command : build
projects : $(solution)
2025-05-05 17:13:50 +07:00
arguments : "--configuration $(buildConfiguration) --no-restore --property:ContinuousIntegrationBuild=true --property:GeneratePackageOnBuild=true --property:PackageOutputPath=$(Build.ArtifactStagingDirectory)/nupkg"
2024-09-16 10:13:26 +02:00
- task : PublishPipelineArtifact@1
displayName : Publish nupkg
inputs :
targetPath : $(Build.ArtifactStagingDirectory)/nupkg
artifactName : nupkg
- task : PublishPipelineArtifact@1
displayName : Publish build artifacts
inputs :
targetPath : $(Build.SourcesDirectory)
artifactName : build_output
2025-05-05 17:13:50 +07:00
- job : B
displayName : Build Bellissima Package
pool :
vmImage : "ubuntu-latest"
steps :
- checkout : self
submodules : false
lfs : false ,
fetchDepth : 500
- template : templates/backoffice-install.yml
- script : npm run build:for:npm
displayName : Run build:for:npm
workingDirectory : src/Umbraco.Web.UI.Client
- bash : |
echo "##[command]Running npm pack"
echo "##[debug]Output directory: $(Build.ArtifactStagingDirectory)"
mkdir $(Build.ArtifactStagingDirectory)/npm
npm pack --pack-destination $(Build.ArtifactStagingDirectory)/npm
mv .npmrc $(Build.ArtifactStagingDirectory)/npm/
displayName : Run npm pack
workingDirectory : src/Umbraco.Web.UI.Client
- task : PublishPipelineArtifact@1
displayName : Publish Bellissima npm artifact
inputs :
targetPath : $(Build.ArtifactStagingDirectory)/npm
artifactName : npm
2025-09-18 10:58:54 +02:00
- stage : Integration
displayName : Integration Tests
dependsOn : Build
condition : ${{ eq(parameters.skipIntegrationTests, false) }}
jobs :
# Integration Tests (SQLite)
- job :
timeoutInMinutes : 180
displayName : Integration Tests (SQLite)
strategy :
matrix :
# Windows:
# vmImage: 'windows-latest'
2025-10-14 12:04:10 +02:00
# We split the tests into 4 parts for each OS to reduce the time it takes to run them on the pipeline
LinuxPart1Of4 :
2025-09-18 10:58:54 +02:00
vmImage : "ubuntu-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)"
2025-10-14 12:04:10 +02:00
LinuxPart2Of4 :
2025-09-18 10:58:54 +02:00
vmImage : "ubuntu-latest"
# Filter tests that are part of the Umbraco.Infrastructure.Service namespace
testFilter : "(FullyQualifiedName~Umbraco.Infrastructure.Service)"
2025-10-14 12:04:10 +02:00
LinuxPart3Of4 :
2025-09-18 10:58:54 +02:00
vmImage : "ubuntu-latest"
2025-10-14 12:04:10 +02:00
# Filter tests that are not part of the Umbraco.Infrastructure and ManagementApi namespace. So this will run all tests that are not part of the Umbraco.Infrastructure namespace
testFilter : "(FullyQualifiedName!~Umbraco.Infrastructure) & (FullyQualifiedName!~ManagementApi)"
LinuxPart4Of4 :
vmImage : "ubuntu-latest"
# Filter tests that are part of the ManagementApi namespace
testFilter : "(FullyQualifiedName~ManagementApi)"
macOSPart1Of4 :
2025-09-18 10:58:54 +02:00
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)"
2025-10-14 12:04:10 +02:00
macOSPart2Of4 :
2025-09-18 10:58:54 +02:00
vmImage : "macOS-latest"
# Filter tests that are part of the Umbraco.Infrastructure.Service namespace
testFilter : "(FullyQualifiedName~Umbraco.Infrastructure.Service)"
2025-10-14 12:04:10 +02:00
macOSPart3Of4 :
vmImage : "macOS-latest"
# Filter tests that are not part of the Umbraco.Infrastructure and ManagementApi namespace.
testFilter : "(FullyQualifiedName!~Umbraco.Infrastructure) & (FullyQualifiedName!~ManagementApi)"
macOSPart4Of4 :
2025-09-18 10:58:54 +02:00
vmImage : "macOS-latest"
2025-10-14 12:04:10 +02:00
# Filter tests that are part of the ManagementApi namespace.
testFilter : "(FullyQualifiedName~ManagementApi)"
2025-09-18 10:58:54 +02:00
pool :
vmImage : $(vmImage)
variables :
Tests__Database__DatabaseType : "Sqlite"
steps :
- checkout : self
submodules : false
lfs : false ,
fetchDepth : 1
fetchFilter : tree:0
# Setup test environment
- task : DownloadPipelineArtifact@2
displayName : Download build artifacts
inputs :
artifact : build_output
path : $(Build.SourcesDirectory)
- task : UseDotNet@2
displayName : Use .NET SDK from global.json
inputs :
useGlobalJson : true
# Test
- task : DotNetCoreCLI@2
displayName : Run dotnet test
inputs :
command : test
projects : "tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj"
testRunTitle : Integration Tests SQLite - $(Agent.OS)
arguments : '--filter "$(testFilter)" --configuration $(buildConfiguration) --no-build'
# Integration Tests (SQL Server)
- job :
timeoutInMinutes : 180
displayName : Integration Tests (SQL Server)
variables :
SA_PASSWORD : UmbracoAcceptance123!
strategy :
matrix :
2025-10-14 12:04:10 +02:00
# We split the tests into 4 parts for each OS to reduce the time it takes to run them on the pipeline
WindowsPart1Of4 :
2025-09-18 10:58:54 +02:00
vmImage : "windows-latest"
Tests__Database__DatabaseType : LocalDb
Tests__Database__SQLServerMasterConnectionString : N /A
# 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)"
2025-10-14 12:04:10 +02:00
WindowsPart2Of4 :
2025-09-18 10:58:54 +02:00
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)"
2025-10-14 12:04:10 +02:00
WindowsPart3Of4 :
2025-09-18 10:58:54 +02:00
vmImage : "windows-latest"
Tests__Database__DatabaseType : LocalDb
Tests__Database__SQLServerMasterConnectionString : N /A
2025-10-14 12:04:10 +02:00
# Filter tests that are not part of the Umbraco.Infrastructure and ManagementApi namespace.
testFilter : "(FullyQualifiedName!~Umbraco.Infrastructure) & (FullyQualifiedName!~ManagementApi)"
WindowsPart4Of4 :
vmImage : "windows-latest"
Tests__Database__DatabaseType : LocalDb
Tests__Database__SQLServerMasterConnectionString : N /A
# Filter tests that are part of the ManagementApi namespace.
testFilter : "(FullyQualifiedName~ManagementApi)"
LinuxPart1Of4 :
2025-09-18 10:58:54 +02:00
vmImage : "ubuntu-latest"
Tests__Database__DatabaseType : SqlServer
Tests__Database__SQLServerMasterConnectionString : "Server=(local);User Id=sa;Password=$(SA_PASSWORD);Encrypt=True;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)"
2025-10-14 12:04:10 +02:00
LinuxPart2Of4 :
2025-09-18 10:58:54 +02:00
vmImage : "ubuntu-latest"
Tests__Database__DatabaseType : SqlServer
Tests__Database__SQLServerMasterConnectionString : "Server=(local);User Id=sa;Password=$(SA_PASSWORD);Encrypt=True;TrustServerCertificate=True"
# Filter tests that are part of the Umbraco.Infrastructure.Service namespace
testFilter : "(FullyQualifiedName~Umbraco.Infrastructure.Service)"
2025-10-14 12:04:10 +02:00
LinuxPart3Of4 :
vmImage : "ubuntu-latest"
Tests__Database__DatabaseType : SqlServer
Tests__Database__SQLServerMasterConnectionString : "Server=(local);User Id=sa;Password=$(SA_PASSWORD);Encrypt=True;TrustServerCertificate=True"
# Filter tests that are not part of the Umbraco.Infrastructure and ManagementApi namespace.
testFilter : "(FullyQualifiedName!~Umbraco.Infrastructure) & (FullyQualifiedName!~ManagementApi)"
LinuxPart4Of4 :
2025-09-18 10:58:54 +02:00
vmImage : "ubuntu-latest"
Tests__Database__DatabaseType : SqlServer
Tests__Database__SQLServerMasterConnectionString : "Server=(local);User Id=sa;Password=$(SA_PASSWORD);Encrypt=True;TrustServerCertificate=True"
2025-10-14 12:04:10 +02:00
# Filter tests that are part of the ManagementApi namespace.
testFilter : "(FullyQualifiedName~ManagementApi)"
2025-09-18 10:58:54 +02:00
pool :
vmImage : $(vmImage)
steps :
# Setup test environment
- task : DownloadPipelineArtifact@2
displayName : Download build artifacts
inputs :
artifact : build_output
path : $(Build.SourcesDirectory)
- task : UseDotNet@2
displayName : Use .NET SDK from global.json
inputs :
useGlobalJson : true
# Start SQL Server
- powershell : docker run --name mssql -d -p 1433:1433 -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=$(SA_PASSWORD)" mcr.microsoft.com/mssql/server:2022-latest
displayName : Start SQL Server Docker image (Linux)
condition : and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
- powershell : |
$maxAttempts = 12
$attempt = 0
$status = ""
while (($status -ne 'running') -and ($attempt -lt $maxAttempts)) {
Start-Sleep -Seconds 5
# We use the docker inspect command to check the status of the container. If the container is not running, we wait 5 seconds and try again. And if reaches 12 attempts, we fail the build.
$status = docker inspect -f '{{.State.Status}}' mssql
if ($status -ne 'running') {
Write-Host "Waiting for SQL Server to be ready... Attempt $($attempt + 1)"
$attempt++
}
}
if ($status -eq 'running') {
Write-Host "SQL Server container is running"
docker ps -a
} else {
Write-Host "SQL Server did not become ready in time. Last known status: $status"
docker logs mssql
exit 1
}
displayName : Wait for SQL Server to be ready (Linux)
condition : and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
- pwsh : SqlLocalDB start MSSQLLocalDB
displayName : Start SQL Server LocalDB (Windows)
condition : and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
# Test
- task : DotNetCoreCLI@2
displayName : Run dotnet test
inputs :
command : test
projects : "tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj"
testRunTitle : Integration Tests SQL Server - $(Agent.OS)
arguments : '--filter "$(testFilter)" --configuration $(buildConfiguration) --no-build'
# Stop SQL Server
- pwsh : docker stop mssql
displayName : Stop SQL Server Docker image (Linux)
condition : and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
- pwsh : SqlLocalDB stop MSSQLLocalDB
displayName : Stop SQL Server LocalDB (Windows)
condition : and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
- stage : DefaultConfigE2E
displayName : Default Config E2E Tests
2024-09-16 10:13:26 +02:00
dependsOn : Build
variables :
npm_config_cache : $(Pipeline.Workspace)/.npm_e2e
# Enable console logging in Release mode
SERILOG__WRITETO__0__NAME : Async
SERILOG__WRITETO__0__ARGS__CONFIGURE__0__NAME : Console
# Set unattended install settings
UMBRACO__CMS__UNATTENDED__INSTALLUNATTENDED : true
UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERNAME : Playwright Test
UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD : UmbracoAcceptance123!
UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL : playwright@umbraco.com
# Custom Umbraco settings
UMBRACO__CMS__CONTENT__CONTENTVERSIONCLEANUPPOLICY__ENABLECLEANUP : false
UMBRACO__CMS__GLOBAL__DISABLEELECTIONFORSINGLESERVER : true
UMBRACO__CMS__GLOBAL__INSTALLMISSINGDATABASE : true
UMBRACO__CMS__GLOBAL__ID : 00000000 -0000 -0000 -0000 -000000000042
UMBRACO__CMS__GLOBAL__VERSIONCHECKPERIOD : 0
UMBRACO__CMS__GLOBAL__USEHTTPS : true
UMBRACO__CMS__HEALTHCHECKS__NOTIFICATION__ENABLED : false
UMBRACO__CMS__KEEPALIVE__DISABLEKEEPALIVETASK : true
UMBRACO__CMS__WEBROUTING__UMBRACOAPPLICATIONURL : https://localhost:44331/
ASPNETCORE_URLS : https://localhost:44331
jobs :
# E2E Tests
- job :
displayName : E2E Tests (SQLite)
2024-09-23 12:10:46 +02:00
timeoutInMinutes : 180
2025-09-18 10:58:54 +02:00
condition : ${{ eq(parameters.skipDefaultConfigAcceptanceTests, false) }}
2024-09-16 10:13:26 +02:00
variables :
# Connection string
CONNECTIONSTRINGS__UMBRACODBDSN : Data Source=Umbraco;Mode=Memory;Cache=Shared;Foreign Keys=True;Pooling=True
CONNECTIONSTRINGS__UMBRACODBDSN_PROVIDERNAME : Microsoft.Data.Sqlite
2025-09-18 10:58:54 +02:00
DatabaseType : SQLite
additionalEnvironmentVariables : false
2024-09-16 10:13:26 +02:00
strategy :
matrix :
2024-12-02 14:48:15 +01:00
LinuxPart1Of3 :
vmImage : "ubuntu-latest"
2025-09-18 10:58:54 +02:00
testFolder : "DefaultConfig"
2025-05-22 11:24:46 +02:00
testCommand : "npm run testSqlite -- --shard=1/3"
2024-12-02 14:48:15 +01:00
LinuxPart2Of3 :
vmImage : "ubuntu-latest"
2025-09-18 10:58:54 +02:00
testFolder : "DefaultConfig"
2025-05-22 11:24:46 +02:00
testCommand : "npm run testSqlite -- --shard=2/3"
2024-12-02 14:48:15 +01:00
LinuxPart3Of3 :
vmImage : "ubuntu-latest"
2025-09-18 10:58:54 +02:00
testFolder : "DefaultConfig"
2025-05-22 11:24:46 +02:00
testCommand : "npm run testSqlite -- --shard=3/3"
2024-12-02 14:48:15 +01:00
WindowsPart1Of3 :
vmImage : "windows-latest"
2025-09-18 10:58:54 +02:00
testFolder : "DefaultConfig"
2025-05-22 11:24:46 +02:00
testCommand : "npm run testSqlite -- --shard=1/3"
2024-12-02 14:48:15 +01:00
WindowsPart2Of3 :
vmImage : "windows-latest"
2025-09-18 10:58:54 +02:00
testFolder : "DefaultConfig"
2025-05-22 11:24:46 +02:00
testCommand : "npm run testSqlite -- --shard=2/3"
2024-12-02 14:48:15 +01:00
WindowsPart3Of3 :
vmImage : "windows-latest"
2025-09-18 10:58:54 +02:00
testFolder : "DefaultConfig"
2025-05-22 11:24:46 +02:00
testCommand : "npm run testSqlite -- --shard=3/3"
2024-09-16 10:13:26 +02:00
pool :
vmImage : $(vmImage)
steps :
2025-09-18 10:58:54 +02:00
# Setup test environment Template
- template : nightly-E2E-setup-template.yml
parameters :
nodeVersion : ${{ variables.nodeVersion }}
PlaywrightUserEmail : ${{ variables.UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL }}
PlaywrightPassword : ${{ variables.UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD }}
ASPNETCORE_URLS : ${{ variables.ASPNETCORE_URLS }}
npm_config_cache : ${{ variables.npm_config_cache }}
2024-09-16 10:13:26 +02:00
- pwsh : |
dotnet restore UmbracoProject
cp $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest.UmbracoProject/*.cs UmbracoProject
2025-09-18 10:58:54 +02:00
displayName : Restore project
2024-09-16 10:13:26 +02:00
workingDirectory : $(Agent.BuildDirectory)/app
- pwsh : |
2025-09-18 10:58:54 +02:00
dotnet build UmbracoProject --configuration ${{ variables.buildConfiguration }} --no-restore
dotnet dev-certs https
displayName : Build application
2024-09-16 10:13:26 +02:00
workingDirectory : $(Agent.BuildDirectory)/app
2025-09-18 10:58:54 +02:00
condition : succeeded()
# Run application Template
- template : nightly-E2E-run-application-template.yml
parameters :
DatabaseType : ${{ variables.DatabaseType }}
buildConfiguration : ${{ variables.buildConfiguration }}
additionalEnvironmentVariables : ${{ variables.additionalEnvironmentVariables }}
# Run tests Template
- template : nightly-E2E-run-tests-template.yml
parameters :
testCommand : $(testCommand)
ASPNETCORE_URLS : ${{ variables.ASPNETCORE_URLS }}
DatabaseType : ${{ variables.DatabaseType }}
2025-03-03 13:11:07 +07:00
2024-09-16 10:13:26 +02:00
- job :
displayName : E2E Tests (SQL Server)
2024-09-23 12:10:46 +02:00
timeoutInMinutes : 180
2025-09-18 10:58:54 +02:00
condition : ${{ eq(parameters.skipDefaultConfigAcceptanceTests, false) }}
2024-09-16 10:13:26 +02:00
variables :
# Connection string
CONNECTIONSTRINGS__UMBRACODBDSN : Data Source=(localdb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\Umbraco.mdf;Integrated Security=True
CONNECTIONSTRINGS__UMBRACODBDSN_PROVIDERNAME : Microsoft.Data.SqlClient
2025-09-18 10:58:54 +02:00
DatabaseType : SQLServer
SA_PASSWORD : UmbracoAcceptance123!
additionalEnvironmentVariables : false
2024-09-16 10:13:26 +02:00
strategy :
matrix :
2024-12-02 14:48:15 +01:00
LinuxPart1Of3 :
2025-05-22 11:24:46 +02:00
testCommand : "npm run test -- --shard=1/3"
2025-09-18 10:58:54 +02:00
testFolder : "DefaultConfig"
2024-12-02 14:48:15 +01:00
vmImage : "ubuntu-latest"
2025-05-08 08:53:29 +02:00
CONNECTIONSTRINGS__UMBRACODBDSN : "Server=(local);Database=Umbraco;User Id=sa;Password=$(SA_PASSWORD);Encrypt=True;TrustServerCertificate=True"
2024-12-02 14:48:15 +01:00
LinuxPart2Of3 :
2025-05-22 11:24:46 +02:00
testCommand : "npm run test -- --shard=2/3"
2025-09-18 10:58:54 +02:00
testFolder : "DefaultConfig"
2024-12-02 14:48:15 +01:00
vmImage : "ubuntu-latest"
2025-05-08 08:53:29 +02:00
CONNECTIONSTRINGS__UMBRACODBDSN : "Server=(local);Database=Umbraco;User Id=sa;Password=$(SA_PASSWORD);Encrypt=True;TrustServerCertificate=True"
2024-12-02 14:48:15 +01:00
LinuxPart3Of3 :
2025-05-22 11:24:46 +02:00
testCommand : "npm run test -- --shard=3/3"
2025-09-18 10:58:54 +02:00
testFolder : "DefaultConfig"
2024-12-02 14:48:15 +01:00
vmImage : "ubuntu-latest"
2025-05-08 08:53:29 +02:00
CONNECTIONSTRINGS__UMBRACODBDSN : "Server=(local);Database=Umbraco;User Id=sa;Password=$(SA_PASSWORD);Encrypt=True;TrustServerCertificate=True"
2024-12-02 14:48:15 +01:00
WindowsPart1Of3 :
2025-11-05 15:54:09 +07:00
testCommand : "npm run testWindows -- --shard=1/3"
2025-09-18 10:58:54 +02:00
testFolder : "DefaultConfig"
2024-12-02 14:48:15 +01:00
vmImage : "windows-latest"
2025-09-18 10:58:54 +02:00
WindowsPart2Of3 :
2025-11-05 15:54:09 +07:00
testCommand : "npm run testWindows -- --shard=2/3"
2025-09-18 10:58:54 +02:00
testFolder : "DefaultConfig"
2024-12-02 14:48:15 +01:00
vmImage : "windows-latest"
2025-09-18 10:58:54 +02:00
WindowsPart3Of3 :
2025-11-05 15:54:09 +07:00
testCommand : "npm run testWindows -- --shard=3/3"
2025-09-18 10:58:54 +02:00
testFolder : "DefaultConfig"
vmImage : "windows-latest"
2024-09-16 10:13:26 +02:00
pool :
vmImage : $(vmImage)
steps :
2025-09-18 10:58:54 +02:00
# Setup test environment Template
- template : nightly-E2E-setup-template.yml
parameters :
nodeVersion : ${{ variables.nodeVersion }}
PlaywrightUserEmail : ${{ variables.UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL }}
PlaywrightPassword : ${{ variables.UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD }}
ASPNETCORE_URLS : ${{ variables.ASPNETCORE_URLS }}
npm_config_cache : ${{ variables.npm_config_cache }}
2024-09-16 10:13:26 +02:00
- pwsh : |
dotnet restore UmbracoProject
cp $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest.UmbracoProject/*.cs UmbracoProject
2025-09-18 10:58:54 +02:00
displayName : Restore project
workingDirectory : $(Agent.BuildDirectory)/app
- pwsh : |
dotnet build UmbracoProject --configuration ${{ variables.buildConfiguration }} --no-restore
2024-09-16 10:13:26 +02:00
dotnet dev-certs https
displayName : Build application
workingDirectory : $(Agent.BuildDirectory)/app
2025-09-18 10:58:54 +02:00
condition : succeeded()
# Run application Template
- template : nightly-E2E-run-application-template.yml
parameters :
SA_PASSWORD : ${{ variables.SA_PASSWORD }}
buildConfiguration : ${{ variables.buildConfiguration }}
DatabaseType : ${{ variables.DatabaseType }}
additionalEnvironmentVariables : ${{ variables.additionalEnvironmentVariables }}
# Run tests Template
- template : nightly-E2E-run-tests-template.yml
parameters :
testCommand : $(testCommand)
ASPNETCORE_URLS : ${{ variables.ASPNETCORE_URLS }}
DatabaseType : ${{ variables.DatabaseType }}
- stage : AdditionalConfigE2E
displayName : Additional Config E2E Tests
dependsOn : Build
variables :
npm_config_cache : $(Pipeline.Workspace)/.npm_e2e
ASPNETCORE_URLS : https://localhost:44331
PlaywrightPassword : UmbracoAcceptance123!
PlaywrightUserEmail : playwright@umbraco.com
jobs :
- job :
displayName : E2E Tests with Different App settings (SQL Server)
2025-11-05 15:54:09 +07:00
condition : ${{ eq(parameters.skipDifferentAppSettingsAcceptanceTests, false) }}
2025-09-18 10:58:54 +02:00
timeoutInMinutes : 180
variables :
SA_PASSWORD : UmbracoAcceptance123!
DatabaseType : SQLServer
strategy :
matrix :
# UnattendedInstallConfig
WindowsUnattendedInstallConfig :
vmImage : "windows-latest"
testFolder : "UnattendedInstallConfig"
testCommand : "npx playwright test --project=unattendedInstallConfig --grep=InstallSQLServer"
port : 44331
additionalEnvironmentVariables : false
# DeliveryApiConfig
WindowsDeliveryApiConfig :
vmImage : "windows-latest"
testFolder : "DeliveryApi"
port : ''
testCommand : "npx playwright test --project=deliveryApi"
CONNECTIONSTRINGS__UMBRACODBDSN : Data Source=(localdb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\Umbraco.mdf;Integrated Security=True
CONNECTIONSTRINGS__UMBRACODBDSN_PROVIDERNAME : Microsoft.Data.SqlClient
additionalEnvironmentVariables : false
LinuxDeliveryApiConfig :
vmImage : "ubuntu-latest"
testFolder : "DeliveryApi"
port : ''
testCommand : "npx playwright test --project=deliveryApi"
CONNECTIONSTRINGS__UMBRACODBDSN : Server=(local);Database=Umbraco;User Id=sa;Password=$(SA_PASSWORD);Encrypt=True;TrustServerCertificate=True
CONNECTIONSTRINGS__UMBRACODBDSN_PROVIDERNAME : Microsoft.Data.SqlClient
additionalEnvironmentVariables : false
# ExternalLogin AzureADB2C
WindowsExternalLoginAzureADB2C :
vmImage : "windows-latest"
testFolder : "ExternalLogin\\AzureADB2C"
testCommand : "npx playwright test --project=externalLoginAzureADB2C"
port : 44331
packageName : "Microsoft.AspNetCore.Authentication.OpenIdConnect"
packageVersion : "9.0.8"
CONNECTIONSTRINGS__UMBRACODBDSN : Data Source=(localdb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\Umbraco.mdf;Integrated Security=True
CONNECTIONSTRINGS__UMBRACODBDSN_PROVIDERNAME : Microsoft.Data.SqlClient
additionalEnvironmentVariables : true
2025-10-06 16:47:06 +07:00
# ExtensionRegistry
WindowsExtensionRegistry :
vmImage : "windows-latest"
testFolder : "ExtensionRegistry"
port : ''
testCommand : "npx playwright test --project=extensionRegistry"
CONNECTIONSTRINGS__UMBRACODBDSN : Data Source=(localdb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\Umbraco.mdf;Integrated Security=True
CONNECTIONSTRINGS__UMBRACODBDSN_PROVIDERNAME : Microsoft.Data.SqlClient
additionalEnvironmentVariables : false
LinuxExtensionRegistry :
vmImage : "ubuntu-latest"
testFolder : "ExtensionRegistry"
port : ''
testCommand : "npx playwright test --project=extensionRegistry"
CONNECTIONSTRINGS__UMBRACODBDSN : Server=(local);Database=Umbraco;User Id=sa;Password=$(SA_PASSWORD);Encrypt=True;TrustServerCertificate=True
CONNECTIONSTRINGS__UMBRACODBDSN_PROVIDERNAME : Microsoft.Data.SqlClient
additionalEnvironmentVariables : false
2025-11-12 10:18:53 +01:00
# EntityDataPicker
WindowsEntityDataPicker :
vmImage : "windows-latest"
testFolder : "EntityDataPicker"
port : ''
testCommand : "npx playwright test --project=entityDataPicker"
CONNECTIONSTRINGS__UMBRACODBDSN : Data Source=(localdb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\Umbraco.mdf;Integrated Security=True
CONNECTIONSTRINGS__UMBRACODBDSN_PROVIDERNAME : Microsoft.Data.SqlClient
additionalEnvironmentVariables : false
LinuxEntityDataPicker :
vmImage : "ubuntu-latest"
testFolder : "EntityDataPicker"
port : ''
testCommand : "npx playwright test --project=entityDataPicker"
CONNECTIONSTRINGS__UMBRACODBDSN : Server=(local);Database=Umbraco;User Id=sa;Password=$(SA_PASSWORD);Encrypt=True;TrustServerCertificate=True
CONNECTIONSTRINGS__UMBRACODBDSN_PROVIDERNAME : Microsoft.Data.SqlClient
additionalEnvironmentVariables : false
2025-11-26 14:34:36 +07:00
# SMTP
LinuxSMTP :
vmImage : "ubuntu-latest"
testFolder : "SMTP"
port : ''
testCommand : "npx playwright test --project=smtp"
CONNECTIONSTRINGS__UMBRACODBDSN : Server=(local);Database=Umbraco;User Id=sa;Password=$(SA_PASSWORD);Encrypt=True;TrustServerCertificate=True
CONNECTIONSTRINGS__UMBRACODBDSN_PROVIDERNAME : Microsoft.Data.SqlClient
additionalEnvironmentVariables : false
2025-09-18 10:58:54 +02:00
pool :
vmImage : $(vmImage)
steps :
# Setup test environment Template
- template : nightly-E2E-setup-template.yml
parameters :
nodeVersion : ${{ variables.nodeVersion }}
PlaywrightUserEmail : ${{ variables.PlaywrightUserEmail }}
PlaywrightPassword : ${{ variables.PlaywrightPassword }}
ASPNETCORE_URLS : ${{ variables.ASPNETCORE_URLS }}
npm_config_cache : ${{ variables.npm_config_cache }}
# Install NuGet package if specified in the matrix
- pwsh : |
Write-Host "Installing package $(packageName) version $(packageVersion)"
dotnet add package $(packageName) --version $(packageVersion)
displayName : "Install NuGet package: $(packageName)"
workingDirectory : $(Agent.BuildDirectory)/app/UmbracoProject
condition : and(succeeded(), ne(variables['packageName'], ''), ne(variables['packageVersion'], ''))
# Build application Template
- template : nightly-E2E-build-template.yml
parameters :
testFolder : $(testFolder)
buildConfiguration : ${{ variables.buildConfiguration }}
additionalEnvironmentVariables : $(additionalEnvironmentVariables)
# Build application for AzureADB2C
- pwsh : |
dotnet build UmbracoProject --configuration ${{ variables.buildConfiguration }} --no-restore
dotnet dev-certs https
displayName : Build application for AzureADB2C
workingDirectory : $(Agent.BuildDirectory)/app
env :
AZUREADB2CDOMAIN : $(AZUREB2CDOMAIN)
AZUREADB2CTENANT : $(AZUREB2CTENANT)
AZUREADB2CPOLICY : $(AZUREB2CPOLICY)
AZUREADB2CCLIENTID : $(AZUREB2CCLIENTID)
AZUREADB2CCLIENTSECRET : $(AZUREB2CCLIENTSECRET)
condition : and(succeeded(), eq(variables['testFolder'], 'ExternalLogin\AzureADB2C'))
# Run application Template
- template : nightly-E2E-run-application-template.yml
parameters :
SA_PASSWORD : ${{ variables.SA_PASSWORD }}
additionalEnvironmentVariables : $(additionalEnvironmentVariables)
buildConfiguration : ${{ variables.buildConfiguration }}
DatabaseType : ${{ variables.DatabaseType }}
# Run application for Linux with additional Environment Variables for Azure AD
2024-09-16 10:13:26 +02:00
- bash : |
2025-09-18 10:58:54 +02:00
nohup dotnet run --project UmbracoProject --configuration ${{ variables.buildConfiguration }} --no-build --no-launch-profile > $(Build.ArtifactStagingDirectory)/playwright.log 2>&1 &
2024-09-16 10:13:26 +02:00
echo "##vso[task.setvariable variable=AcceptanceTestProcessId]$!"
displayName : Run application (Linux)
2025-09-18 10:58:54 +02:00
condition : and(succeeded(), eq(variables['Agent.OS'], 'Linux'), eq(variables['testFolder'], 'ExternalLogin\AzureADB2C'))
2024-09-16 10:13:26 +02:00
workingDirectory : $(Agent.BuildDirectory)/app
2025-09-18 10:58:54 +02:00
env :
AZUREADB2CDOMAIN : $(AZUREB2CDOMAIN)
AZUREADB2CTENANT : $(AZUREB2CTENANT)
AZUREADB2CPOLICY : $(AZUREB2CPOLICY)
AZUREADB2CCLIENTID : $(AZUREB2CCLIENTID)
AZUREADB2CCLIENTSECRET : $(AZUREB2CCLIENTSECRET)
2024-09-16 10:13:26 +02:00
2025-09-18 10:58:54 +02:00
# Run application for Windows with additional Environment Variables for Azure AD
2024-09-16 10:13:26 +02:00
- pwsh : |
2025-09-18 10:58:54 +02:00
$process = Start-Process dotnet "run --project UmbracoProject --configuration ${{ variables.buildConfiguration }} --no-build --no-launch-profile 2>&1" -PassThru -NoNewWindow -RedirectStandardOutput $(Build.ArtifactStagingDirectory)/playwright.log
2024-09-16 10:13:26 +02:00
Write-Host "##vso[task.setvariable variable=AcceptanceTestProcessId]$($process.Id)"
displayName : Run application (Windows)
2025-09-18 10:58:54 +02:00
condition : and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'), eq(variables['testFolder'], 'ExternalLogin\AzureADB2C'))
2024-09-16 10:13:26 +02:00
workingDirectory : $(Agent.BuildDirectory)/app
env :
2025-09-18 10:58:54 +02:00
AZUREADB2CDOMAIN : $(AZUREB2CDOMAIN)
AZUREADB2CTENANT : $(AZUREB2CTENANT)
AZUREADB2CPOLICY : $(AZUREB2CPOLICY)
AZUREADB2CCLIENTID : $(AZUREB2CCLIENTID)
AZUREADB2CCLIENTSECRET : $(AZUREB2CCLIENTSECRET)
2025-11-26 14:34:36 +07:00
# Start SMTP4dev via Docker for SMTP tests
- bash : |
echo "Starting SMTP4dev container..."
docker run -d --name smtp4dev -p 5000:80 -p 25:25 rnwood/smtp4dev
echo "Waiting for SMTP4dev to be ready..."
for i in {1..30}; do
if curl -s http://localhost:5000/api/messages > /dev/null; then
echo "SMTP4dev is ready"
break
fi
echo "Attempt $i: Waiting for SMTP4dev..."
sleep 2
done
displayName : Start SMTP4dev Docker container (Linux)
condition : and(succeeded(), eq(variables['Agent.OS'], 'Linux'), contains(variables['testFolder'], 'SMTP'))
2025-09-18 10:58:54 +02:00
# Run tests Template
- template : nightly-E2E-run-tests-template.yml
parameters :
testCommand : $(testCommand)
ASPNETCORE_URLS : ${{ variables.ASPNETCORE_URLS }}
port : $(port)
AZUREB2CTESTUSEREMAIL : $(AZUREB2CTESTUSEREMAIL)
AZUREB2CTESTUSERPASSWORD : $(AZUREB2CTESTUSERPASSWORD)
DatabaseType : ${{ variables.DatabaseType }}
2025-11-26 14:34:36 +07:00
# Stop SMTP4dev container
- bash : |
echo "Stopping SMTP4dev container..."
docker stop smtp4dev
docker rm smtp4dev
displayName : Stop SMTP4dev Docker container
condition : and(succeeded(), eq(variables['Agent.OS'], 'Linux'), contains(variables['testFolder'], 'SMTP'))
2025-08-06 12:43:35 +02:00
- stage : NotifySlackBot
displayName : Notify Slack on Failure
2025-09-18 10:58:54 +02:00
dependsOn : DefaultConfigE2E
2025-08-06 12:43:35 +02:00
# This stage will only run if the E2E tests fail or succeed with issues
2025-09-18 10:58:54 +02:00
condition : or(eq(dependencies.DefaultConfigE2E.result, 'failed'), eq(dependencies.DefaultConfigE2E.result, 'succeededWithIssues'))
2025-08-06 12:43:35 +02:00
jobs :
- job : PostToSlack
displayName : Send Slack Notification
pool :
vmImage : 'ubuntu-latest'
steps :
# We send a payload to the Slack webhook URL, which will post a message to a specific channel
- bash : |
PROJECT_NAME_ENCODED=$(echo -n "$SYSTEM_TEAMPROJECT" | jq -s -R -r @uri)
PIPELINE_URL="${SYSTEM_TEAMFOUNDATIONCOLLECTIONURI}${PROJECT_NAME_ENCODED}/_build/results?buildId=${BUILD_BUILDID}&view=ms.vss-test-web.build-test-results-tab"
PAYLOAD="{
\"attachments\": [
{
\"color\": \"#ff0000\",
\"pretext\": \"Nightly E2E pipeline *${BUILD_DEFINITIONNAME}* (#${BUILD_BUILDNUMBER}) failed!\",
\"title\": \"View Failed E2E Test Results\",
\"title_link\": \"$PIPELINE_URL\",
\"fields\": [
{
\"title\": \"Pipeline\",
\"value\": \"${BUILD_DEFINITIONNAME}\",
\"short\": true
},
{
\"title\": \"Build ID\",
\"value\": \"${BUILD_BUILDID}\",
\"short\": true
}
]
}
]
}"
echo "Sending Slack message to: $PIPELINE_URL"
curl -X POST -H 'Content-type : application/json' \
--data "$PAYLOAD" \
"$SLACK_WEBHOOK_URL"
env :
2025-11-04 08:23:04 +01:00
SLACK_WEBHOOK_URL : $(E2ESLACKWEBHOOKURL)