@@ -513,9 +513,9 @@ stages:
513
513
UMBRACO__CMS__WEBROUTING__UMBRACOAPPLICATIONURL : https://localhost:44331/
514
514
ASPNETCORE_URLS : https://localhost:44331
515
515
jobs :
516
- # E2E Tests
516
+ # E2E Smoke Tests
517
517
- job :
518
- displayName : E2E Tests (SQLite)
518
+ displayName : E2E Smoke Tests (SQLite)
519
519
# currently disabled due to DB locks randomly occuring.
520
520
condition : eq(${{parameters.sqliteAcceptanceTests}}, True)
521
521
variables :
@@ -678,7 +678,7 @@ stages:
678
678
testRunTitle : " $(Agent.JobName)"
679
679
680
680
- job :
681
- displayName : E2E Tests (SQL Server)
681
+ displayName : E2E Smoke Tests (SQL Server)
682
682
variables :
683
683
# Connection string
684
684
CONNECTIONSTRINGS__UMBRACODBDSN : Data Source=(localdb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\Umbraco.mdf;Integrated Security=True
@@ -862,6 +862,176 @@ stages:
862
862
searchFolder : " tests/Umbraco.Tests.AcceptanceTest/results"
863
863
testRunTitle : " $(Agent.JobName)"
864
864
865
+ - job :
866
+ displayName : E2E Release Tests (SQL Server)
867
+ variables :
868
+ # Connection string
869
+ CONNECTIONSTRINGS__UMBRACODBDSN : Data Source=(localdb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\Umbraco.mdf;Integrated Security=True
870
+ CONNECTIONSTRINGS__UMBRACODBDSN_PROVIDERNAME : Microsoft.Data.SqlClient
871
+ condition : eq(dependencies.Build.outputs['A.build.NBGV_PublicRelease'], 'True')
872
+ strategy :
873
+ matrix :
874
+ WindowsPart1Of3 :
875
+ vmImage : " windows-latest"
876
+ testCommand : " npm run releaseTest -- --shard=1/3"
877
+ WindowsPart2Of3 :
878
+ vmImage : " windows-latest"
879
+ testCommand : " npm run releaseTest -- --shard=2/3"
880
+ WindowsPart3Of3 :
881
+ vmImage : " windows-latest"
882
+ testCommand : " npm run releaseTest -- --shard=3/3"
883
+ pool :
884
+ vmImage : $(vmImage)
885
+ steps :
886
+ # Setup test environment
887
+ - task : DownloadPipelineArtifact@2
888
+ displayName : Download NuGet artifacts
889
+ inputs :
890
+ artifact : nupkg
891
+ path : $(Agent.BuildDirectory)/app/nupkg
892
+
893
+ - task : NodeTool@0
894
+ displayName : Use Node.js $(nodeVersion)
895
+ inputs :
896
+ versionSpec : $(nodeVersion)
897
+
898
+ - task : UseDotNet@2
899
+ displayName : Use .NET SDK from global.json
900
+ inputs :
901
+ useGlobalJson : true
902
+
903
+ - pwsh : |
904
+ "UMBRACO_USER_LOGIN=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSEREMAIL)
905
+ UMBRACO_USER_PASSWORD=$(UMBRACO__CMS__UNATTENDED__UNATTENDEDUSERPASSWORD)
906
+ URL=$(ASPNETCORE_URLS)
907
+ STORAGE_STAGE_PATH=$(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/playwright/.auth/user.json
908
+ CONSOLE_ERRORS_PATH=$(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/console-errors.json" | Out-File .env
909
+ displayName: Generate .env
910
+ workingDirectory: $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest
911
+
912
+ # Cache and restore NPM packages
913
+ - task : Cache@2
914
+ displayName : Cache NPM packages
915
+ inputs :
916
+ key : ' npm_e2e | "$(Agent.OS)" | $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest/package-lock.json'
917
+ restoreKeys : |
918
+ npm_e2e | "$(Agent.OS)"
919
+ npm_e2e
920
+ path : $(npm_config_cache)
921
+
922
+ - script : npm ci --no-fund --no-audit --prefer-offline
923
+ workingDirectory : $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest
924
+ displayName : Restore NPM packages
925
+
926
+ # Build application
927
+ - pwsh : |
928
+ $cmsVersion = "$(Build.BuildNumber)" -replace "\+",".g"
929
+ dotnet new nugetconfig
930
+ dotnet nuget add source ./nupkg --name Local
931
+ dotnet new install Umbraco.Templates::$cmsVersion
932
+ dotnet new umbraco --name UmbracoProject --version $cmsVersion --exclude-gitignore --no-restore --no-update-check
933
+ dotnet restore UmbracoProject
934
+ cp $(Build.SourcesDirectory)/tests/Umbraco.Tests.AcceptanceTest.UmbracoProject/*.cs UmbracoProject
935
+ dotnet build UmbracoProject --configuration $(buildConfiguration) --no-restore
936
+ dotnet dev-certs https
937
+ displayName: Build application
938
+ workingDirectory: $(Agent.BuildDirectory)/app
939
+
940
+ # Start SQL Server
941
+ - 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
942
+ displayName : Start SQL Server Docker image (Linux)
943
+ condition : and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
944
+
945
+ - pwsh : SqlLocalDB start MSSQLLocalDB
946
+ displayName : Start SQL Server LocalDB (Windows)
947
+ condition : and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
948
+
949
+ # Run application
950
+ - bash : |
951
+ nohup dotnet run --project UmbracoProject --configuration $(buildConfiguration) --no-build --no-launch-profile > $(Build.ArtifactStagingDirectory)/playwright.log 2>&1 &
952
+ echo "##vso[task.setvariable variable=AcceptanceTestProcessId]$!"
953
+ displayName: Run application (Linux)
954
+ condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
955
+ workingDirectory: $(Agent.BuildDirectory)/app
956
+
957
+ - pwsh : |
958
+ $process = Start-Process dotnet "run --project UmbracoProject --configuration $(buildConfiguration) --no-build --no-launch-profile 2>&1" -PassThru -NoNewWindow -RedirectStandardOutput $(Build.ArtifactStagingDirectory)/playwright.log
959
+ Write-Host "##vso[task.setvariable variable=AcceptanceTestProcessId]$($process.Id)"
960
+ displayName: Run application (Windows)
961
+ condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
962
+ workingDirectory: $(Agent.BuildDirectory)/app
963
+
964
+ # Wait for application to start responding to requests
965
+ - pwsh : npx wait-on -v --interval 1000 --timeout 120000 $(ASPNETCORE_URLS)
966
+ displayName : Wait for application
967
+ workingDirectory : tests/Umbraco.Tests.AcceptanceTest
968
+
969
+ # Install Playwright and dependencies
970
+ - pwsh : npx playwright install chromium
971
+ displayName : Install Playwright only with Chromium browser
972
+ workingDirectory : tests/Umbraco.Tests.AcceptanceTest
973
+
974
+ # Test
975
+ - pwsh : $(testCommand)
976
+ displayName : Run Playwright tests
977
+ workingDirectory : tests/Umbraco.Tests.AcceptanceTest
978
+ env :
979
+ CI : true
980
+ CommitId : $(Build.SourceVersion)
981
+ AgentOs : $(Agent.OS)
982
+
983
+ # Stop application
984
+ - bash : kill -15 $(AcceptanceTestProcessId)
985
+ displayName : Stop application (Linux)
986
+ condition : and(ne(variables.AcceptanceTestProcessId, ''), eq(variables['Agent.OS'], 'Linux'))
987
+
988
+ - pwsh : Stop-Process -Id $(AcceptanceTestProcessId)
989
+ displayName : Stop application (Windows)
990
+ condition : and(ne(variables.AcceptanceTestProcessId, ''), eq(variables['Agent.OS'], 'Windows_NT'))
991
+
992
+ # Stop SQL Server
993
+ - pwsh : docker stop mssql
994
+ displayName : Stop SQL Server Docker image (Linux)
995
+ condition : eq(variables['Agent.OS'], 'Linux')
996
+
997
+ - pwsh : SqlLocalDB stop MSSQLLocalDB
998
+ displayName : Stop SQL Server LocalDB (Windows)
999
+ condition : eq(variables['Agent.OS'], 'Windows_NT')
1000
+
1001
+ # Copy artifacts
1002
+ - pwsh : |
1003
+ if (Test-Path tests/Umbraco.Tests.AcceptanceTest/results/*) {
1004
+ Copy-Item tests/Umbraco.Tests.AcceptanceTest/results/* $(Build.ArtifactStagingDirectory) -Recurse
1005
+ }
1006
+ displayName: Copy Playwright results
1007
+ condition: succeededOrFailed()
1008
+
1009
+ # Copy console error log
1010
+ - pwsh : |
1011
+ if (Test-Path tests/Umbraco.Tests.AcceptanceTest/console-errors.json) {
1012
+ Copy-Item tests/Umbraco.Tests.AcceptanceTest/console-errors.json $(Build.ArtifactStagingDirectory)
1013
+ }
1014
+ displayName: Copy console error log
1015
+ condition: succeededOrFailed()
1016
+
1017
+ # Publish test artifacts
1018
+ - task : PublishPipelineArtifact@1
1019
+ displayName : Publish test artifacts
1020
+ condition : succeededOrFailed()
1021
+ inputs :
1022
+ targetPath : $(Build.ArtifactStagingDirectory)
1023
+ artifact : " Acceptance Test Results - $(Agent.JobName) - Attempt #$(System.JobAttempt)"
1024
+
1025
+ # Publish test results
1026
+ - task : PublishTestResults@2
1027
+ displayName : " Publish test results"
1028
+ condition : succeededOrFailed()
1029
+ inputs :
1030
+ testResultsFormat : ' JUnit'
1031
+ testResultsFiles : ' *.xml'
1032
+ searchFolder : " tests/Umbraco.Tests.AcceptanceTest/results"
1033
+ testRunTitle : " $(Agent.JobName)"
1034
+
865
1035
# ##############################################
866
1036
# # Release
867
1037
# ##############################################
@@ -1067,4 +1237,4 @@ stages:
1067
1237
storage : umbracoapidocs
1068
1238
ContainerName : " $web"
1069
1239
BlobPrefix : v$(umbracoMajorVersion)/ui-api
1070
- CleanTargetBeforeCopy : true
1240
+ CleanTargetBeforeCopy : true
0 commit comments