From f62ec9fd076e94609b7c3f67768c6a334dcd94ec Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Tue, 24 Nov 2020 12:56:01 +0100 Subject: [PATCH 01/41] Adding yaml file for setting up CI with Azure Pipelines --- build/azure-pipelines.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 build/azure-pipelines.yml diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml new file mode 100644 index 0000000000..b4afa0b0f8 --- /dev/null +++ b/build/azure-pipelines.yml @@ -0,0 +1,22 @@ +############################################################################# +## ASP.NET Core ## +## Build and test ASP.NET Core projects targeting .NET Core. ## +## Runs tests, creates NuGet packages: ## +## https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core ## +############################################################################# + +# Build Pipeline triggers +trigger: +- master + +# VM to run the build on & it's installed software +pool: + vmImage: 'ubuntu-latest' + +# Variables & their default values +variables: + buildConfiguration: 'Release' + +steps: +- script: dotnet build --configuration $(buildConfiguration) + displayName: 'dotnet build $(buildConfiguration)' From ebf2a8cee9076ad245ef353bb115be0b22f35863 Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Tue, 24 Nov 2020 14:06:54 +0100 Subject: [PATCH 02/41] Adding clearly defined tasks for restore and build --- build/azure-pipelines.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index b4afa0b0f8..3b2f8ea7dc 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -18,5 +18,23 @@ variables: buildConfiguration: 'Release' steps: -- script: dotnet build --configuration $(buildConfiguration) - displayName: 'dotnet build $(buildConfiguration)' +- task: UseDotNet@2 + displayName: 'Use .Net Core sdk 3.1.100' + inputs: + version: 3.1.100 + +- task: NuGetToolInstaller@1 + displayName: 'Use NuGet Latest' + +- task: NuGetCommand@2 + displayName: 'Restore NuGet Packages' + inputs: + restoreSolution: '**/src/umbraco-netcore-only.sln' + feedsToUse: config + +- task: DotNetCoreCLI@2 + displayName: Build + inputs: + command: build + projects: '**/src/Umbraco.Web.UI.NetCore/*.csproj' + arguments: '--configuration $(buildConfiguration)' From f743cd7e4a68a523993941344567f8029197df15 Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Tue, 24 Nov 2020 14:51:07 +0100 Subject: [PATCH 03/41] Defining linux job --- build/azure-pipelines.yml | 37 +++++++++++++------------------------ 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 3b2f8ea7dc..135cfa9b12 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -9,32 +9,21 @@ trigger: - master -# VM to run the build on & it's installed software -pool: - vmImage: 'ubuntu-latest' - # Variables & their default values variables: buildConfiguration: 'Release' -steps: -- task: UseDotNet@2 - displayName: 'Use .Net Core sdk 3.1.100' +jobs: +- job: Linux + pool: + vmImage: 'ubuntu-latest' + steps: + - task: UseDotNet@2 + displayName: 'Use .Net Core sdk 3.1.100' + inputs: + version: 3.1.100 + - task: DotNetCoreCLI@2 + displayName: 'dotnet test' inputs: - version: 3.1.100 - -- task: NuGetToolInstaller@1 - displayName: 'Use NuGet Latest' - -- task: NuGetCommand@2 - displayName: 'Restore NuGet Packages' - inputs: - restoreSolution: '**/src/umbraco-netcore-only.sln' - feedsToUse: config - -- task: DotNetCoreCLI@2 - displayName: Build - inputs: - command: build - projects: '**/src/Umbraco.Web.UI.NetCore/*.csproj' - arguments: '--configuration $(buildConfiguration)' + command: test + projects: '**\Umbraco.Tests.UnitTests.csproj' From cb2631ce02ed5fc4c2556b751099ccb437aa047f Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Tue, 24 Nov 2020 15:07:42 +0100 Subject: [PATCH 04/41] Removing hard-coded trigger --- build/azure-pipelines.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 135cfa9b12..d6afa3bb98 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -5,10 +5,6 @@ ## https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core ## ############################################################################# -# Build Pipeline triggers -trigger: -- master - # Variables & their default values variables: buildConfiguration: 'Release' From 8fa15b25619a80bac2cb6dd995b75ef71dffa2a6 Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Tue, 24 Nov 2020 15:12:12 +0100 Subject: [PATCH 05/41] Fixing indentation --- build/azure-pipelines.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index d6afa3bb98..76536f91dd 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -19,7 +19,7 @@ jobs: inputs: version: 3.1.100 - task: DotNetCoreCLI@2 - displayName: 'dotnet test' - inputs: - command: test - projects: '**\Umbraco.Tests.UnitTests.csproj' + displayName: 'dotnet test' + inputs: + command: test + projects: '**\Umbraco.Tests.UnitTests.csproj' From 7ead4a47ff951d925b5c32843a2db5bd0a5e8779 Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Tue, 24 Nov 2020 15:20:32 +0100 Subject: [PATCH 06/41] Specifying project path pattern --- build/azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 76536f91dd..4cc773ff88 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -22,4 +22,4 @@ jobs: displayName: 'dotnet test' inputs: command: test - projects: '**\Umbraco.Tests.UnitTests.csproj' + projects: '**/src/Umbraco.Web.UI.NetCore/*.csproj' From 21312a09eaa7e25aa018235a14a11c631331f32a Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Tue, 24 Nov 2020 15:41:36 +0100 Subject: [PATCH 07/41] More general wildcard for project path --- build/azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 4cc773ff88..cde291866f 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -22,4 +22,4 @@ jobs: displayName: 'dotnet test' inputs: command: test - projects: '**/src/Umbraco.Web.UI.NetCore/*.csproj' + projects: '**\*.Tests.UnitTests.csproj' From 27379ba89a2a79305591e764a106dc2592e84221 Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Tue, 24 Nov 2020 15:50:29 +0100 Subject: [PATCH 08/41] Linux path syntax rules --- build/azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index cde291866f..e95c17931c 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -22,4 +22,4 @@ jobs: displayName: 'dotnet test' inputs: command: test - projects: '**\*.Tests.UnitTests.csproj' + projects: '**/*.Tests.UnitTests.csproj' From 2b89ce07d36cd58ef466032565ee906b3c0dd29d Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Tue, 24 Nov 2020 16:21:03 +0100 Subject: [PATCH 09/41] Setting up Windows agent --- build/azure-pipelines.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index e95c17931c..087828bf35 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -14,12 +14,31 @@ jobs: pool: vmImage: 'ubuntu-latest' steps: + - task: UseDotNet@2 displayName: 'Use .Net Core sdk 3.1.100' inputs: version: 3.1.100 + - task: DotNetCoreCLI@2 displayName: 'dotnet test' inputs: command: test projects: '**/*.Tests.UnitTests.csproj' + + +- job: Windows + pool: + vmImage: 'windows-latest' + steps: + + - task: UseDotNet@2 + displayName: 'Use .Net Core sdk 3.1.100' + inputs: + version: 3.1.100 + + - task: DotNetCoreCLI@2 + displayName: 'dotnet test' + inputs: + command: test + projects: '**\*.Tests.UnitTests.csproj' From 8d4169dde280ca49867e1627e02aaea72eb2d37a Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Tue, 24 Nov 2020 16:24:25 +0100 Subject: [PATCH 10/41] Indentation issues --- build/azure-pipelines.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 087828bf35..55f7b4ff73 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -33,9 +33,9 @@ jobs: steps: - task: UseDotNet@2 - displayName: 'Use .Net Core sdk 3.1.100' - inputs: - version: 3.1.100 + displayName: 'Use .Net Core sdk 3.1.100' + inputs: + version: 3.1.100 - task: DotNetCoreCLI@2 displayName: 'dotnet test' From b0186e5a8ed503cbcce63da35244b7577e4ba36b Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 25 Nov 2020 07:47:05 +0100 Subject: [PATCH 11/41] Added azure-pipelines.yml to the sln file Signed-off-by: Bjarke Berg --- src/umbraco.sln | 1 + 1 file changed, 1 insertion(+) diff --git a/src/umbraco.sln b/src/umbraco.sln index 6216b3128b..56fcd1215e 100644 --- a/src/umbraco.sln +++ b/src/umbraco.sln @@ -11,6 +11,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{2849E9D4 ..\build\build.ps1 = ..\build\build.ps1 ..\NuGet.Config = ..\NuGet.Config SolutionInfo.cs = SolutionInfo.cs + ..\build\azure-pipelines.yml = ..\build\azure-pipelines.yml EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{FD962632-184C-4005-A5F3-E705D92FC645}" From b198e7891dfdf116bbcf90d1707aeddf37afccdc Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Thu, 26 Nov 2020 08:26:09 +0100 Subject: [PATCH 12/41] Adding steps for restoring nuget pckgs --- build/azure-pipelines.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 55f7b4ff73..768aeeb3f3 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -42,3 +42,12 @@ jobs: inputs: command: test projects: '**\*.Tests.UnitTests.csproj' + + - task: NuGetToolInstaller@1 + displayName: 'Use NuGet Latest' + + - task: NuGetCommand@2 + displayName: 'Restore NuGet Packages' + inputs: + restoreSolution: '*\src\umbraco.sln' + feedsToUse: config From 49c6c41463a3ea84771c1547a915f6f7c6000ae6 Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Thu, 26 Nov 2020 08:41:55 +0100 Subject: [PATCH 13/41] Steps for preparing packages & verifying nuget --- build/azure-pipelines.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 768aeeb3f3..c4324dafc7 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -51,3 +51,26 @@ jobs: inputs: restoreSolution: '*\src\umbraco.sln' feedsToUse: config + + - task: PowerShell@1 + displayName: 'Prepare Packages' + inputs: + scriptType: inlineScript + inlineScript: | + Write-Host "Working folder: $pwd" + $ubuild = build/build.ps1 -get + + $uenv.CompileUmbraco() + + $ubuild.PreparePackages() + + - task: PowerShell@1 + displayName: 'Verify & Prepare NuGet' + inputs: + scriptType: inlineScript + inlineScript: | + Write-Host "Working folder: $pwd" + $ubuild = build/build.ps1 -get -continue + + $ubuild.VerifyNuGet() + $ubuild.PrepareNuGet() From de81606d0608ff333e5367c3ae030bec16f99808 Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Thu, 26 Nov 2020 08:47:29 +0100 Subject: [PATCH 14/41] Fix call to CompileUmbraco() --- build/azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index c4324dafc7..03a308b6e1 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -60,7 +60,7 @@ jobs: Write-Host "Working folder: $pwd" $ubuild = build/build.ps1 -get - $uenv.CompileUmbraco() + $ubuild.CompileUmbraco() $ubuild.PreparePackages() From c52d8c911fa3827cfb196552423da0fe5be2cc85 Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Thu, 26 Nov 2020 09:24:12 +0100 Subject: [PATCH 15/41] lists the files in the current working directory --- build/azure-pipelines.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 03a308b6e1..12649cac7d 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -58,6 +58,7 @@ jobs: scriptType: inlineScript inlineScript: | Write-Host "Working folder: $pwd" + ls $ubuild = build/build.ps1 -get $ubuild.CompileUmbraco() @@ -70,6 +71,7 @@ jobs: scriptType: inlineScript inlineScript: | Write-Host "Working folder: $pwd" + ls $ubuild = build/build.ps1 -get -continue $ubuild.VerifyNuGet() From a3694e9f6e7827c8975d42a334f834337be39123 Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Thu, 26 Nov 2020 10:58:05 +0100 Subject: [PATCH 16/41] Adding Prepare build step --- build/azure-pipelines.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 12649cac7d..7ae8f14b86 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -52,13 +52,22 @@ jobs: restoreSolution: '*\src\umbraco.sln' feedsToUse: config + - task: PowerShell@1 + displayName: 'Prepare Build' + inputs: + scriptType: inlineScript + inlineScript: | + Write-Host "Working folder: $pwd" + $ubuild = build/build.ps1 -get + + $ubuild.PrepareBuild("vso") + - task: PowerShell@1 displayName: 'Prepare Packages' inputs: scriptType: inlineScript inlineScript: | Write-Host "Working folder: $pwd" - ls $ubuild = build/build.ps1 -get $ubuild.CompileUmbraco() @@ -71,7 +80,6 @@ jobs: scriptType: inlineScript inlineScript: | Write-Host "Working folder: $pwd" - ls $ubuild = build/build.ps1 -get -continue $ubuild.VerifyNuGet() From f0c7fc5fca933f13e6a99bc69f1221267e7918ce Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Thu, 26 Nov 2020 11:32:48 +0100 Subject: [PATCH 17/41] Adding steps for node, npm and gulp --- build/azure-pipelines.yml | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 7ae8f14b86..9bf12fd741 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -58,17 +58,37 @@ jobs: scriptType: inlineScript inlineScript: | Write-Host "Working folder: $pwd" - $ubuild = build/build.ps1 -get + $ubuild = build\build.ps1 -get $ubuild.PrepareBuild("vso") + - task: NodeTool@0 + displayName: 'Use Node 11.x' + inputs: + versionSpec: 11.x + + - task: Npm@1 + displayName: 'npm install' + inputs: + workingDir: *\src\Umbraco.Web.UI.Client + verbose: false + + - task: gulp@0 + displayName: 'gulp build' + inputs: + gulpFile: src\Umbraco.Web.UI.Client\gulpfile.js + targets: build + workingDirectory: src\Umbraco.Web.UI.Client + publishJUnitResults: true + testResultsFiles: '**\TESTS-*.xml' + - task: PowerShell@1 displayName: 'Prepare Packages' inputs: scriptType: inlineScript inlineScript: | Write-Host "Working folder: $pwd" - $ubuild = build/build.ps1 -get + $ubuild = build\build.ps1 -get -continue $ubuild.CompileUmbraco() @@ -80,7 +100,7 @@ jobs: scriptType: inlineScript inlineScript: | Write-Host "Working folder: $pwd" - $ubuild = build/build.ps1 -get -continue + $ubuild = build\build.ps1 -get -continue $ubuild.VerifyNuGet() $ubuild.PrepareNuGet() From 35523c4fc08c1f304b6900a6a6e69fbe18748a56 Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Thu, 26 Nov 2020 11:40:10 +0100 Subject: [PATCH 18/41] yaml syntax error --- build/azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 9bf12fd741..df7f5939dd 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -76,7 +76,7 @@ jobs: - task: gulp@0 displayName: 'gulp build' inputs: - gulpFile: src\Umbraco.Web.UI.Client\gulpfile.js + gulpFile: 'src\Umbraco.Web.UI.Client\gulpfile.js' targets: build workingDirectory: src\Umbraco.Web.UI.Client publishJUnitResults: true From 5ba4f8f01e88a8191b1c1ff8363175e0159bda68 Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Thu, 26 Nov 2020 11:42:06 +0100 Subject: [PATCH 19/41] another syntax fix --- build/azure-pipelines.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index df7f5939dd..f3ca7556e0 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -70,13 +70,13 @@ jobs: - task: Npm@1 displayName: 'npm install' inputs: - workingDir: *\src\Umbraco.Web.UI.Client + workingDir: src\Umbraco.Web.UI.Client verbose: false - task: gulp@0 displayName: 'gulp build' inputs: - gulpFile: 'src\Umbraco.Web.UI.Client\gulpfile.js' + gulpFile: src\Umbraco.Web.UI.Client\gulpfile.js targets: build workingDirectory: src\Umbraco.Web.UI.Client publishJUnitResults: true From 2d3bc4bef62f806fbd738c46496a86164c9592fa Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Thu, 26 Nov 2020 12:00:26 +0100 Subject: [PATCH 20/41] Fixing step for building the nuget packages --- build/azure-pipelines.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index f3ca7556e0..a201c5392d 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -91,11 +91,10 @@ jobs: $ubuild = build\build.ps1 -get -continue $ubuild.CompileUmbraco() - $ubuild.PreparePackages() - task: PowerShell@1 - displayName: 'Verify & Prepare NuGet' + displayName: 'Verify & Package NuGet' inputs: scriptType: inlineScript inlineScript: | @@ -103,4 +102,4 @@ jobs: $ubuild = build\build.ps1 -get -continue $ubuild.VerifyNuGet() - $ubuild.PrepareNuGet() + $ubuild.PackageNuGet() From 03504399f29461c23aea1ac9296dffa4c66c564a Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Thu, 26 Nov 2020 12:48:38 +0100 Subject: [PATCH 21/41] Adding stages --- build/azure-pipelines.yml | 154 ++++++++++++++++++++------------------ 1 file changed, 80 insertions(+), 74 deletions(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index a201c5392d..f6685aa1f8 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -26,80 +26,86 @@ jobs: command: test projects: '**/*.Tests.UnitTests.csproj' +stages: +- stage: Windows + jobs: -- job: Windows - pool: - vmImage: 'windows-latest' - steps: + - job: Unit Tests + pool: + vmImage: 'windows-latest' + steps: + + - task: UseDotNet@2 + displayName: 'Use .Net Core sdk 3.1.100' + inputs: + version: 3.1.100 + + - task: DotNetCoreCLI@2 + displayName: 'dotnet test' + inputs: + command: test + projects: '**\*.Tests.UnitTests.csproj' + + - task: NuGetToolInstaller@1 + displayName: 'Use NuGet Latest' + + - task: NuGetCommand@2 + displayName: 'Restore NuGet Packages' + inputs: + restoreSolution: '*\src\umbraco.sln' + feedsToUse: config + + - task: PowerShell@1 + displayName: 'Prepare Build' + inputs: + scriptType: inlineScript + inlineScript: | + Write-Host "Working folder: $pwd" + $ubuild = build\build.ps1 -get + + $ubuild.PrepareBuild("vso") + + - task: NodeTool@0 + displayName: 'Use Node 11.x' + inputs: + versionSpec: 11.x + + - task: Npm@1 + displayName: 'npm install' + inputs: + workingDir: src\Umbraco.Web.UI.Client + verbose: false + + - task: gulp@0 + displayName: 'gulp build' + inputs: + gulpFile: src\Umbraco.Web.UI.Client\gulpfile.js + targets: build + workingDirectory: src\Umbraco.Web.UI.Client + publishJUnitResults: true + testResultsFiles: '**\TESTS-*.xml' + + - task: PowerShell@1 + displayName: 'Prepare Packages' + inputs: + scriptType: inlineScript + inlineScript: | + Write-Host "Working folder: $pwd" + $ubuild = build\build.ps1 -get -continue + + $ubuild.CompileUmbraco() + $ubuild.PreparePackages() + + - task: PowerShell@1 + displayName: 'Verify & Package NuGet' + inputs: + scriptType: inlineScript + inlineScript: | + Write-Host "Working folder: $pwd" + $ubuild = build\build.ps1 -get -continue + + $ubuild.VerifyNuGet() + $ubuild.PackageNuGet() - - task: UseDotNet@2 - displayName: 'Use .Net Core sdk 3.1.100' - inputs: - version: 3.1.100 - - task: DotNetCoreCLI@2 - displayName: 'dotnet test' - inputs: - command: test - projects: '**\*.Tests.UnitTests.csproj' - - - task: NuGetToolInstaller@1 - displayName: 'Use NuGet Latest' - - - task: NuGetCommand@2 - displayName: 'Restore NuGet Packages' - inputs: - restoreSolution: '*\src\umbraco.sln' - feedsToUse: config - - - task: PowerShell@1 - displayName: 'Prepare Build' - inputs: - scriptType: inlineScript - inlineScript: | - Write-Host "Working folder: $pwd" - $ubuild = build\build.ps1 -get - - $ubuild.PrepareBuild("vso") - - - task: NodeTool@0 - displayName: 'Use Node 11.x' - inputs: - versionSpec: 11.x - - - task: Npm@1 - displayName: 'npm install' - inputs: - workingDir: src\Umbraco.Web.UI.Client - verbose: false - - - task: gulp@0 - displayName: 'gulp build' - inputs: - gulpFile: src\Umbraco.Web.UI.Client\gulpfile.js - targets: build - workingDirectory: src\Umbraco.Web.UI.Client - publishJUnitResults: true - testResultsFiles: '**\TESTS-*.xml' - - - task: PowerShell@1 - displayName: 'Prepare Packages' - inputs: - scriptType: inlineScript - inlineScript: | - Write-Host "Working folder: $pwd" - $ubuild = build\build.ps1 -get -continue - - $ubuild.CompileUmbraco() - $ubuild.PreparePackages() - - - task: PowerShell@1 - displayName: 'Verify & Package NuGet' - inputs: - scriptType: inlineScript - inlineScript: | - Write-Host "Working folder: $pwd" - $ubuild = build\build.ps1 -get -continue - - $ubuild.VerifyNuGet() - $ubuild.PackageNuGet() + - job: Integration Tests From 80379499c3bb793b2621e60e81908a0cadb0505c Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Thu, 26 Nov 2020 12:50:41 +0100 Subject: [PATCH 22/41] syntax issue --- build/azure-pipelines.yml | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index f6685aa1f8..373b2598d0 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -9,24 +9,26 @@ variables: buildConfiguration: 'Release' -jobs: -- job: Linux - pool: - vmImage: 'ubuntu-latest' - steps: - - - task: UseDotNet@2 - displayName: 'Use .Net Core sdk 3.1.100' - inputs: - version: 3.1.100 - - - task: DotNetCoreCLI@2 - displayName: 'dotnet test' - inputs: - command: test - projects: '**/*.Tests.UnitTests.csproj' - stages: +- stage: Linux + jobs: + - job: Linux Unit Tests + pool: + vmImage: 'ubuntu-latest' + steps: + + - task: UseDotNet@2 + displayName: 'Use .Net Core sdk 3.1.100' + inputs: + version: 3.1.100 + + - task: DotNetCoreCLI@2 + displayName: 'dotnet test' + inputs: + command: test + projects: '**/*.Tests.UnitTests.csproj' + + - stage: Windows jobs: From 8168667267768143505e916e50510a151d175189 Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Thu, 26 Nov 2020 12:59:52 +0100 Subject: [PATCH 23/41] adding displayName --- build/azure-pipelines.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 373b2598d0..516fde39ac 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -11,7 +11,9 @@ variables: stages: - stage: Linux + displayName: 'Linux' jobs: + - job: Linux Unit Tests pool: vmImage: 'ubuntu-latest' @@ -30,6 +32,7 @@ stages: - stage: Windows + displayName: 'Windows' jobs: - job: Unit Tests From e5b3f84371fd61b1715580b38274bb5be0017fd0 Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Thu, 26 Nov 2020 13:03:09 +0100 Subject: [PATCH 24/41] Fix naming --- build/azure-pipelines.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 516fde39ac..8cbfb7305c 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -14,7 +14,8 @@ stages: displayName: 'Linux' jobs: - - job: Linux Unit Tests + - job: Unit_Tests + displayName: 'Unit Tests' pool: vmImage: 'ubuntu-latest' steps: @@ -35,7 +36,8 @@ stages: displayName: 'Windows' jobs: - - job: Unit Tests + - job: Unit_Tests + displayName: 'Unit Tests' pool: vmImage: 'windows-latest' steps: @@ -113,4 +115,5 @@ stages: $ubuild.PackageNuGet() - - job: Integration Tests + - job: Integration_Tests + displayName: 'Integration Tests' From 10cb685b05b1547271aee8ce25a45951b2c0c570 Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Thu, 26 Nov 2020 13:24:05 +0100 Subject: [PATCH 25/41] Adding steps for running the Integration Tests --- build/azure-pipelines.yml | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 8cbfb7305c..6c93c27136 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -11,7 +11,6 @@ variables: stages: - stage: Linux - displayName: 'Linux' jobs: - job: Unit_Tests @@ -33,7 +32,6 @@ stages: - stage: Windows - displayName: 'Windows' jobs: - job: Unit_Tests @@ -117,3 +115,26 @@ stages: - job: Integration_Tests displayName: 'Integration Tests' + pool: + vmImage: 'windows-latest' + steps: + + - task: UseDotNet@2 + displayName: 'Use .Net Core sdk 3.1.100' + inputs: + version: 3.1.100 + + - task: DotNetCoreCLI@2 + displayName: 'dotnet build' + inputs: + projects: '**\Umbraco.Tests.Integration.csproj' + + - powershell: 'sqllocaldb start mssqllocaldb' + displayName: 'Start MSSQL LocalDb' + + - task: DotNetCoreCLI@2 + displayName: 'dotnet test' + inputs: + command: test + projects: '**\Umbraco.Tests.Integration.csproj' + arguments: '--no-build' From 5c70ed1e74c383e6d8bf3c88ef72b6efb40930d3 Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Tue, 1 Dec 2020 08:39:05 +0100 Subject: [PATCH 26/41] Updated .Net Core sdk version --- build/azure-pipelines.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 6c93c27136..e68f64cab3 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -20,9 +20,9 @@ stages: steps: - task: UseDotNet@2 - displayName: 'Use .Net Core sdk 3.1.100' + displayName: 'Use .Net Core sdk 5.x' inputs: - version: 3.1.100 + version: 5.x - task: DotNetCoreCLI@2 displayName: 'dotnet test' @@ -41,9 +41,9 @@ stages: steps: - task: UseDotNet@2 - displayName: 'Use .Net Core sdk 3.1.100' + displayName: 'Use .Net Core sdk 5.x' inputs: - version: 3.1.100 + version: 5.x - task: DotNetCoreCLI@2 displayName: 'dotnet test' @@ -120,9 +120,9 @@ stages: steps: - task: UseDotNet@2 - displayName: 'Use .Net Core sdk 3.1.100' + displayName: 'Use .Net Core sdk 5.x' inputs: - version: 3.1.100 + version: 5.x - task: DotNetCoreCLI@2 displayName: 'dotnet build' From fe2d407fcb8f847f8bb25d6b2a170c2cd48c6ca8 Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Tue, 1 Dec 2020 09:16:09 +0100 Subject: [PATCH 27/41] Update the sdk version format --- build/azure-pipelines.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index e68f64cab3..12effd58ee 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -20,9 +20,9 @@ stages: steps: - task: UseDotNet@2 - displayName: 'Use .Net Core sdk 5.x' + displayName: 'Use .Net Core sdk 5.0.x' inputs: - version: 5.x + version: 5.0.x - task: DotNetCoreCLI@2 displayName: 'dotnet test' @@ -41,9 +41,9 @@ stages: steps: - task: UseDotNet@2 - displayName: 'Use .Net Core sdk 5.x' + displayName: 'Use .Net Core sdk 5.0.x' inputs: - version: 5.x + version: 5.0.x - task: DotNetCoreCLI@2 displayName: 'dotnet test' @@ -120,9 +120,9 @@ stages: steps: - task: UseDotNet@2 - displayName: 'Use .Net Core sdk 5.x' + displayName: 'Use .Net Core sdk 5.0.x' inputs: - version: 5.x + version: 5.0.x - task: DotNetCoreCLI@2 displayName: 'dotnet build' From 23173b966b575d138b17f8cc4c88734f723824de Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Tue, 1 Dec 2020 09:31:16 +0100 Subject: [PATCH 28/41] Test with .net core sdk version 5.0.x didn't work so reverting back to 3.1.x --- build/azure-pipelines.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 12effd58ee..31a01924e4 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -20,9 +20,9 @@ stages: steps: - task: UseDotNet@2 - displayName: 'Use .Net Core sdk 5.0.x' + displayName: 'Use .Net Core sdk 3.1.x' inputs: - version: 5.0.x + version: 3.1.x - task: DotNetCoreCLI@2 displayName: 'dotnet test' @@ -41,9 +41,9 @@ stages: steps: - task: UseDotNet@2 - displayName: 'Use .Net Core sdk 5.0.x' + displayName: 'Use .Net Core sdk 3.1.x' inputs: - version: 5.0.x + version: 3.1.x - task: DotNetCoreCLI@2 displayName: 'dotnet test' @@ -120,9 +120,9 @@ stages: steps: - task: UseDotNet@2 - displayName: 'Use .Net Core sdk 5.0.x' + displayName: 'Use .Net Core sdk 3.1.x' inputs: - version: 5.0.x + version: 3.1.x - task: DotNetCoreCLI@2 displayName: 'dotnet build' From 0a6b96e8f55a2db4a857e29ed8a1e6efd857de9e Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Tue, 1 Dec 2020 11:06:17 +0100 Subject: [PATCH 29/41] Publishing artifacts --- build/azure-pipelines.yml | 47 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 31a01924e4..7e9c33b98e 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -91,7 +91,7 @@ stages: testResultsFiles: '**\TESTS-*.xml' - task: PowerShell@1 - displayName: 'Prepare Packages' + displayName: 'Prepare Packages & Zip' inputs: scriptType: inlineScript inlineScript: | @@ -100,6 +100,21 @@ stages: $ubuild.CompileUmbraco() $ubuild.PreparePackages() + $ubuild.PackageZip() + + - task: CopyFiles@2 + displayName: 'Copy Zip Files to Staging' + inputs: + SourceFolder: build.out + Contents: '*.zip' + TargetFolder: '$(build.artifactstagingdirectory)' + CleanTargetFolder: true + + - task: PublishBuildArtifacts@1 + displayName: 'Publish Zip Files' + inputs: + PathtoPublish: '$(build.artifactstagingdirectory)' + ArtifactName: zips - task: PowerShell@1 displayName: 'Verify & Package NuGet' @@ -112,6 +127,36 @@ stages: $ubuild.VerifyNuGet() $ubuild.PackageNuGet() + - task: CopyFiles@2 + displayName: 'Copy NuPkg Files to Staging' + inputs: + SourceFolder: build.out + Contents: '*.nupkg' + TargetFolder: '$(build.artifactstagingdirectory)' + CleanTargetFolder: true + + - task: PublishBuildArtifacts@1 + displayName: 'Publish NuPkg Files' + inputs: + PathtoPublish: '$(build.artifactstagingdirectory)' + ArtifactName: nupkg + + - task: CopyFiles@2 + displayName: 'Copy Log Files to Staging' + inputs: + SourceFolder: build.tmp + Contents: '*.log' + TargetFolder: '$(build.artifactstagingdirectory)' + CleanTargetFolder: true + condition: succeededOrFailed() + + - task: PublishBuildArtifacts@1 + displayName: 'Publish Log Files' + inputs: + PathtoPublish: '$(build.artifactstagingdirectory)' + ArtifactName: logs + condition: succeededOrFailed() + - job: Integration_Tests displayName: 'Integration Tests' From 55cd83bbac2f73f66de6ee5de562762f22d92fda Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com> Date: Tue, 1 Dec 2020 15:03:29 +0100 Subject: [PATCH 30/41] Update azure-pipelines.yml for Azure Pipelines Copied over the yaml file as something is acting up --- build/azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 7e9c33b98e..1ba32a3e8f 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -182,4 +182,4 @@ stages: inputs: command: test projects: '**\Umbraco.Tests.Integration.csproj' - arguments: '--no-build' + arguments: '--no-build' \ No newline at end of file From 8d7ec23f6913f3c1029b272f94de2bce0146ac32 Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Tue, 1 Dec 2020 15:15:34 +0100 Subject: [PATCH 31/41] Reverting back the netcore sdk version --- build/azure-pipelines.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 1ba32a3e8f..f235530d03 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -22,7 +22,7 @@ stages: - task: UseDotNet@2 displayName: 'Use .Net Core sdk 3.1.x' inputs: - version: 3.1.x + version: 3.1.100 - task: DotNetCoreCLI@2 displayName: 'dotnet test' @@ -43,7 +43,7 @@ stages: - task: UseDotNet@2 displayName: 'Use .Net Core sdk 3.1.x' inputs: - version: 3.1.x + version: 3.1.100 - task: DotNetCoreCLI@2 displayName: 'dotnet test' @@ -167,7 +167,7 @@ stages: - task: UseDotNet@2 displayName: 'Use .Net Core sdk 3.1.x' inputs: - version: 3.1.x + version: 3.1.100 - task: DotNetCoreCLI@2 displayName: 'dotnet build' From 8ea2787f08e48d0749c05f52622a7d224f827ad1 Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska Date: Tue, 1 Dec 2020 15:30:06 +0100 Subject: [PATCH 32/41] using again 3.1.x format of .net core sdk verison --- build/azure-pipelines.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index f235530d03..1ba32a3e8f 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -22,7 +22,7 @@ stages: - task: UseDotNet@2 displayName: 'Use .Net Core sdk 3.1.x' inputs: - version: 3.1.100 + version: 3.1.x - task: DotNetCoreCLI@2 displayName: 'dotnet test' @@ -43,7 +43,7 @@ stages: - task: UseDotNet@2 displayName: 'Use .Net Core sdk 3.1.x' inputs: - version: 3.1.100 + version: 3.1.x - task: DotNetCoreCLI@2 displayName: 'dotnet test' @@ -167,7 +167,7 @@ stages: - task: UseDotNet@2 displayName: 'Use .Net Core sdk 3.1.x' inputs: - version: 3.1.100 + version: 3.1.x - task: DotNetCoreCLI@2 displayName: 'dotnet build' From 3d82873028d96687dd578d5bd987d9f09e8fa629 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 2 Dec 2020 07:55:51 +0100 Subject: [PATCH 33/41] Fix issue with MapPath Signed-off-by: Bjarke Berg --- src/Umbraco.Tests.Common/TestHelperBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Tests.Common/TestHelperBase.cs b/src/Umbraco.Tests.Common/TestHelperBase.cs index 095879209a..886253b8dc 100644 --- a/src/Umbraco.Tests.Common/TestHelperBase.cs +++ b/src/Umbraco.Tests.Common/TestHelperBase.cs @@ -46,7 +46,7 @@ namespace Umbraco.Tests.Common public TypeLoader GetMockedTypeLoader() { - return new TypeLoader(Mock.Of(), Mock.Of(), new DirectoryInfo(IOHelper.MapPath("~/App_Data/TEMP")), Mock.Of>(), Mock.Of()); + return new TypeLoader(Mock.Of(), Mock.Of(), new DirectoryInfo(GetHostingEnvironment().MapPathContentRoot("~/App_Data/TEMP")), Mock.Of>(), Mock.Of()); } // public Configs GetConfigs() => GetConfigsFactory().Create(); From d23986101bf1c5d18c0bd637ff61d6f126773717 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 2 Dec 2020 08:21:17 +0100 Subject: [PATCH 34/41] Fix more issues with MapPath Signed-off-by: Bjarke Berg --- .../Umbraco.Core/Composing/TypeLoaderTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeLoaderTests.cs b/src/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeLoaderTests.cs index 8486dabcbf..20e9f8feef 100644 --- a/src/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeLoaderTests.cs +++ b/src/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeLoaderTests.cs @@ -28,7 +28,7 @@ namespace Umbraco.Tests.UnitTests.Umbraco.Core.Composing // this ensures it's reset var typeFinder = TestHelper.GetTypeFinder(); _typeLoader = new TypeLoader(typeFinder, NoAppCache.Instance, - new DirectoryInfo(TestHelper.IOHelper.MapPath("~/App_Data/TEMP")), + new DirectoryInfo(TestHelper.GetHostingEnvironment().MapPathContentRoot("~/App_Data/TEMP")), Mock.Of>(), new ProfilingLogger(Mock.Of>(), Mock.Of()), false, // for testing, we'll specify which assemblies are scanned for the PluginTypeResolver From a00c195f262646e619cf197d9dd49a203e378d49 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 2 Dec 2020 08:27:37 +0100 Subject: [PATCH 35/41] Fix more issues with MapPath Signed-off-by: Bjarke Berg --- .../Umbraco.Core/Components/ComponentTests.cs | 9 ++++----- .../Umbraco.Core/Composing/ComposingTestBase.cs | 3 +-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Tests.UnitTests/Umbraco.Core/Components/ComponentTests.cs b/src/Umbraco.Tests.UnitTests/Umbraco.Core/Components/ComponentTests.cs index 4cc2a54327..4a6c73c8c4 100644 --- a/src/Umbraco.Tests.UnitTests/Umbraco.Core/Components/ComponentTests.cs +++ b/src/Umbraco.Tests.UnitTests/Umbraco.Core/Components/ComponentTests.cs @@ -68,7 +68,7 @@ namespace Umbraco.Tests.UnitTests.Umbraco.Core.Components private static TypeLoader MockTypeLoader() { var ioHelper = IOHelper; - return new TypeLoader(Mock.Of(), Mock.Of(), new DirectoryInfo(ioHelper.MapPath("~/App_Data/TEMP")), Mock.Of>(), Mock.Of()); + return new TypeLoader(Mock.Of(), Mock.Of(), new DirectoryInfo(TestHelper.GetHostingEnvironment().MapPathContentRoot("~/App_Data/TEMP")), Mock.Of>(), Mock.Of()); } @@ -83,7 +83,7 @@ namespace Umbraco.Tests.UnitTests.Umbraco.Core.Components var composers = new Composers(composition, types, Enumerable.Empty(), Mock.Of>()); Composed.Clear(); // 2 is Core and requires 4 - // 3 is User + // 3 is User // => reorder components accordingly composers.Compose(); AssertTypeArray(TypeArray(), Composed); @@ -377,13 +377,12 @@ namespace Umbraco.Tests.UnitTests.Umbraco.Core.Components [Test] public void AllComposers() { - var ioHelper = IOHelper; var typeFinder = TestHelper.GetTypeFinder(); - var typeLoader = new TypeLoader(typeFinder, AppCaches.Disabled.RuntimeCache, new DirectoryInfo(ioHelper.MapPath("~/App_Data/TEMP")), Mock.Of>(), Mock.Of()); + var typeLoader = new TypeLoader(typeFinder, AppCaches.Disabled.RuntimeCache, new DirectoryInfo(TestHelper.GetHostingEnvironment().MapPathContentRoot("~/App_Data/TEMP")), Mock.Of>(), Mock.Of()); var register = MockRegister(); var builder = new UmbracoBuilder(register, Mock.Of(), TestHelper.GetMockedTypeLoader()); - + var allComposers = typeLoader.GetTypes().ToList(); var types = allComposers.Where(x => x.FullName.StartsWith("Umbraco.Core.") || x.FullName.StartsWith("Umbraco.Web")).ToList(); diff --git a/src/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/ComposingTestBase.cs b/src/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/ComposingTestBase.cs index 66d55cda39..43760d1c6c 100644 --- a/src/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/ComposingTestBase.cs +++ b/src/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/ComposingTestBase.cs @@ -23,8 +23,7 @@ namespace Umbraco.Tests.UnitTests.Umbraco.Core.Composing ProfilingLogger = new ProfilingLogger(Mock.Of>(), Mock.Of()); var typeFinder = TestHelper.GetTypeFinder(); - var ioHelper = TestHelper.IOHelper; - TypeLoader = new TypeLoader(typeFinder, NoAppCache.Instance, new DirectoryInfo(ioHelper.MapPath("~/App_Data/TEMP")), Mock.Of>(), ProfilingLogger, false, AssembliesToScan); + TypeLoader = new TypeLoader(typeFinder, NoAppCache.Instance, new DirectoryInfo(TestHelper.GetHostingEnvironment().MapPathContentRoot("~/App_Data/TEMP")), Mock.Of>(), ProfilingLogger, false, AssembliesToScan); } protected virtual IEnumerable AssembliesToScan From 43278183e718c990dbd44e199d5af7925ebc31ee Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 2 Dec 2020 08:38:50 +0100 Subject: [PATCH 36/41] https://github.com/umbraco/Umbraco-CMS/pull/9459 run stages in parallel Signed-off-by: Bjarke Berg --- build/azure-pipelines.yml | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 1ba32a3e8f..1781b06fce 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -18,12 +18,12 @@ stages: pool: vmImage: 'ubuntu-latest' steps: - + - task: UseDotNet@2 displayName: 'Use .Net Core sdk 3.1.x' inputs: version: 3.1.x - + - task: DotNetCoreCLI@2 displayName: 'dotnet test' inputs: @@ -32,6 +32,7 @@ stages: - stage: Windows + dependsOn: [] # this removes the implicit dependency on previous stage and causes this to run in parallel jobs: - job: Unit_Tests @@ -39,27 +40,27 @@ stages: pool: vmImage: 'windows-latest' steps: - + - task: UseDotNet@2 displayName: 'Use .Net Core sdk 3.1.x' inputs: version: 3.1.x - + - task: DotNetCoreCLI@2 displayName: 'dotnet test' inputs: command: test projects: '**\*.Tests.UnitTests.csproj' - + - task: NuGetToolInstaller@1 displayName: 'Use NuGet Latest' - + - task: NuGetCommand@2 displayName: 'Restore NuGet Packages' inputs: restoreSolution: '*\src\umbraco.sln' feedsToUse: config - + - task: PowerShell@1 displayName: 'Prepare Build' inputs: @@ -67,20 +68,20 @@ stages: inlineScript: | Write-Host "Working folder: $pwd" $ubuild = build\build.ps1 -get - + $ubuild.PrepareBuild("vso") - + - task: NodeTool@0 displayName: 'Use Node 11.x' inputs: versionSpec: 11.x - + - task: Npm@1 displayName: 'npm install' inputs: workingDir: src\Umbraco.Web.UI.Client verbose: false - + - task: gulp@0 displayName: 'gulp build' inputs: @@ -89,7 +90,7 @@ stages: workingDirectory: src\Umbraco.Web.UI.Client publishJUnitResults: true testResultsFiles: '**\TESTS-*.xml' - + - task: PowerShell@1 displayName: 'Prepare Packages & Zip' inputs: @@ -97,7 +98,7 @@ stages: inlineScript: | Write-Host "Working folder: $pwd" $ubuild = build\build.ps1 -get -continue - + $ubuild.CompileUmbraco() $ubuild.PreparePackages() $ubuild.PackageZip() @@ -115,7 +116,7 @@ stages: inputs: PathtoPublish: '$(build.artifactstagingdirectory)' ArtifactName: zips - + - task: PowerShell@1 displayName: 'Verify & Package NuGet' inputs: @@ -123,7 +124,7 @@ stages: inlineScript: | Write-Host "Working folder: $pwd" $ubuild = build\build.ps1 -get -continue - + $ubuild.VerifyNuGet() $ubuild.PackageNuGet() @@ -134,7 +135,7 @@ stages: Contents: '*.nupkg' TargetFolder: '$(build.artifactstagingdirectory)' CleanTargetFolder: true - + - task: PublishBuildArtifacts@1 displayName: 'Publish NuPkg Files' inputs: @@ -149,7 +150,7 @@ stages: TargetFolder: '$(build.artifactstagingdirectory)' CleanTargetFolder: true condition: succeededOrFailed() - + - task: PublishBuildArtifacts@1 displayName: 'Publish Log Files' inputs: @@ -173,7 +174,7 @@ stages: displayName: 'dotnet build' inputs: projects: '**\Umbraco.Tests.Integration.csproj' - + - powershell: 'sqllocaldb start mssqllocaldb' displayName: 'Start MSSQL LocalDb' @@ -182,4 +183,4 @@ stages: inputs: command: test projects: '**\Umbraco.Tests.Integration.csproj' - arguments: '--no-build' \ No newline at end of file + arguments: '--no-build' From 9f5437a72e757dccaf514c6d40e864249ab9610a Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 2 Dec 2020 08:53:49 +0100 Subject: [PATCH 37/41] https://github.com/umbraco/Umbraco-CMS/pull/9459 seperate unit tests and build artifacts into two jobs Signed-off-by: Bjarke Berg --- build/azure-pipelines.yml | 224 ++++++++++++++++++++------------------ 1 file changed, 117 insertions(+), 107 deletions(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 1781b06fce..296fd2069e 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -52,113 +52,6 @@ stages: command: test projects: '**\*.Tests.UnitTests.csproj' - - task: NuGetToolInstaller@1 - displayName: 'Use NuGet Latest' - - - task: NuGetCommand@2 - displayName: 'Restore NuGet Packages' - inputs: - restoreSolution: '*\src\umbraco.sln' - feedsToUse: config - - - task: PowerShell@1 - displayName: 'Prepare Build' - inputs: - scriptType: inlineScript - inlineScript: | - Write-Host "Working folder: $pwd" - $ubuild = build\build.ps1 -get - - $ubuild.PrepareBuild("vso") - - - task: NodeTool@0 - displayName: 'Use Node 11.x' - inputs: - versionSpec: 11.x - - - task: Npm@1 - displayName: 'npm install' - inputs: - workingDir: src\Umbraco.Web.UI.Client - verbose: false - - - task: gulp@0 - displayName: 'gulp build' - inputs: - gulpFile: src\Umbraco.Web.UI.Client\gulpfile.js - targets: build - workingDirectory: src\Umbraco.Web.UI.Client - publishJUnitResults: true - testResultsFiles: '**\TESTS-*.xml' - - - task: PowerShell@1 - displayName: 'Prepare Packages & Zip' - inputs: - scriptType: inlineScript - inlineScript: | - Write-Host "Working folder: $pwd" - $ubuild = build\build.ps1 -get -continue - - $ubuild.CompileUmbraco() - $ubuild.PreparePackages() - $ubuild.PackageZip() - - - task: CopyFiles@2 - displayName: 'Copy Zip Files to Staging' - inputs: - SourceFolder: build.out - Contents: '*.zip' - TargetFolder: '$(build.artifactstagingdirectory)' - CleanTargetFolder: true - - - task: PublishBuildArtifacts@1 - displayName: 'Publish Zip Files' - inputs: - PathtoPublish: '$(build.artifactstagingdirectory)' - ArtifactName: zips - - - task: PowerShell@1 - displayName: 'Verify & Package NuGet' - inputs: - scriptType: inlineScript - inlineScript: | - Write-Host "Working folder: $pwd" - $ubuild = build\build.ps1 -get -continue - - $ubuild.VerifyNuGet() - $ubuild.PackageNuGet() - - - task: CopyFiles@2 - displayName: 'Copy NuPkg Files to Staging' - inputs: - SourceFolder: build.out - Contents: '*.nupkg' - TargetFolder: '$(build.artifactstagingdirectory)' - CleanTargetFolder: true - - - task: PublishBuildArtifacts@1 - displayName: 'Publish NuPkg Files' - inputs: - PathtoPublish: '$(build.artifactstagingdirectory)' - ArtifactName: nupkg - - - task: CopyFiles@2 - displayName: 'Copy Log Files to Staging' - inputs: - SourceFolder: build.tmp - Contents: '*.log' - TargetFolder: '$(build.artifactstagingdirectory)' - CleanTargetFolder: true - condition: succeededOrFailed() - - - task: PublishBuildArtifacts@1 - displayName: 'Publish Log Files' - inputs: - PathtoPublish: '$(build.artifactstagingdirectory)' - ArtifactName: logs - condition: succeededOrFailed() - - - job: Integration_Tests displayName: 'Integration Tests' pool: @@ -184,3 +77,120 @@ stages: command: test projects: '**\Umbraco.Tests.Integration.csproj' arguments: '--no-build' + + - job: Build_artifacts + displayName: 'Build Artifacts' + pool: + vmImage: 'windows-latest' + steps: + + - task: UseDotNet@2 + displayName: 'Use .Net Core sdk 3.1.x' + inputs: + version: 3.1.x + + - task: NuGetToolInstaller@1 + displayName: 'Use NuGet Latest' + + - task: NuGetCommand@2 + displayName: 'Restore NuGet Packages' + inputs: + restoreSolution: '*\src\umbraco.sln' + feedsToUse: config + + - task: PowerShell@1 + displayName: 'Prepare Build' + inputs: + scriptType: inlineScript + inlineScript: | + Write-Host "Working folder: $pwd" + $ubuild = build\build.ps1 -get + + $ubuild.PrepareBuild("vso") + + - task: NodeTool@0 + displayName: 'Use Node 11.x' + inputs: + versionSpec: 11.x + + - task: Npm@1 + displayName: 'npm install' + inputs: + workingDir: src\Umbraco.Web.UI.Client + verbose: false + + - task: gulp@0 + displayName: 'gulp build' + inputs: + gulpFile: src\Umbraco.Web.UI.Client\gulpfile.js + targets: build + workingDirectory: src\Umbraco.Web.UI.Client + publishJUnitResults: true + testResultsFiles: '**\TESTS-*.xml' + + - task: PowerShell@1 + displayName: 'Prepare Packages & Zip' + inputs: + scriptType: inlineScript + inlineScript: | + Write-Host "Working folder: $pwd" + $ubuild = build\build.ps1 -get -continue + + $ubuild.CompileUmbraco() + $ubuild.PreparePackages() + $ubuild.PackageZip() + + - task: CopyFiles@2 + displayName: 'Copy Zip Files to Staging' + inputs: + SourceFolder: build.out + Contents: '*.zip' + TargetFolder: '$(build.artifactstagingdirectory)' + CleanTargetFolder: true + + - task: PublishBuildArtifacts@1 + displayName: 'Publish Zip Files' + inputs: + PathtoPublish: '$(build.artifactstagingdirectory)' + ArtifactName: zips + + - task: PowerShell@1 + displayName: 'Verify & Package NuGet' + inputs: + scriptType: inlineScript + inlineScript: | + Write-Host "Working folder: $pwd" + $ubuild = build\build.ps1 -get -continue + + $ubuild.VerifyNuGet() + $ubuild.PackageNuGet() + + - task: CopyFiles@2 + displayName: 'Copy NuPkg Files to Staging' + inputs: + SourceFolder: build.out + Contents: '*.nupkg' + TargetFolder: '$(build.artifactstagingdirectory)' + CleanTargetFolder: true + + - task: PublishBuildArtifacts@1 + displayName: 'Publish NuPkg Files' + inputs: + PathtoPublish: '$(build.artifactstagingdirectory)' + ArtifactName: nupkg + + - task: CopyFiles@2 + displayName: 'Copy Log Files to Staging' + inputs: + SourceFolder: build.tmp + Contents: '*.log' + TargetFolder: '$(build.artifactstagingdirectory)' + CleanTargetFolder: true + condition: succeededOrFailed() + + - task: PublishBuildArtifacts@1 + displayName: 'Publish Log Files' + inputs: + PathtoPublish: '$(build.artifactstagingdirectory)' + ArtifactName: logs + condition: succeededOrFailed() From 23ac4eb8fb2e3fc0696fd57f875ffdbc733aef49 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 2 Dec 2020 08:56:24 +0100 Subject: [PATCH 38/41] https://github.com/umbraco/Umbraco-CMS/pull/9459 seperate unit tests and build artifacts into two jobs Signed-off-by: Bjarke Berg --- build/azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 296fd2069e..2c5a403362 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -78,7 +78,7 @@ stages: projects: '**\Umbraco.Tests.Integration.csproj' arguments: '--no-build' - - job: Build_artifacts + - job: Build_artifacts displayName: 'Build Artifacts' pool: vmImage: 'windows-latest' From af03b98071ec0c7f21cb8525d0e97704432dbad6 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 2 Dec 2020 09:03:45 +0100 Subject: [PATCH 39/41] https://github.com/umbraco/Umbraco-CMS/pull/9459 Indentation Signed-off-by: Bjarke Berg --- build/azure-pipelines.yml | 198 +++++++++++++++++++------------------- 1 file changed, 100 insertions(+), 98 deletions(-) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 2c5a403362..acaaf75b70 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -52,6 +52,7 @@ stages: command: test projects: '**\*.Tests.UnitTests.csproj' + - job: Integration_Tests displayName: 'Integration Tests' pool: @@ -78,119 +79,120 @@ stages: projects: '**\Umbraco.Tests.Integration.csproj' arguments: '--no-build' - - job: Build_artifacts - displayName: 'Build Artifacts' - pool: - vmImage: 'windows-latest' - steps: - - task: UseDotNet@2 - displayName: 'Use .Net Core sdk 3.1.x' - inputs: - version: 3.1.x + - job: Build_Artifacts + displayName: 'Build Artifacts' + pool: + vmImage: 'windows-latest' + steps: - - task: NuGetToolInstaller@1 - displayName: 'Use NuGet Latest' + - task: UseDotNet@2 + displayName: 'Use .Net Core sdk 3.1.x' + inputs: + version: 3.1.x - - task: NuGetCommand@2 - displayName: 'Restore NuGet Packages' - inputs: - restoreSolution: '*\src\umbraco.sln' - feedsToUse: config + - task: NuGetToolInstaller@1 + displayName: 'Use NuGet Latest' - - task: PowerShell@1 - displayName: 'Prepare Build' - inputs: - scriptType: inlineScript - inlineScript: | - Write-Host "Working folder: $pwd" - $ubuild = build\build.ps1 -get + - task: NuGetCommand@2 + displayName: 'Restore NuGet Packages' + inputs: + restoreSolution: '*\src\umbraco.sln' + feedsToUse: config - $ubuild.PrepareBuild("vso") + - task: PowerShell@1 + displayName: 'Prepare Build' + inputs: + scriptType: inlineScript + inlineScript: | + Write-Host "Working folder: $pwd" + $ubuild = build\build.ps1 -get - - task: NodeTool@0 - displayName: 'Use Node 11.x' - inputs: - versionSpec: 11.x + $ubuild.PrepareBuild("vso") - - task: Npm@1 - displayName: 'npm install' - inputs: - workingDir: src\Umbraco.Web.UI.Client - verbose: false + - task: NodeTool@0 + displayName: 'Use Node 11.x' + inputs: + versionSpec: 11.x - - task: gulp@0 - displayName: 'gulp build' - inputs: - gulpFile: src\Umbraco.Web.UI.Client\gulpfile.js - targets: build - workingDirectory: src\Umbraco.Web.UI.Client - publishJUnitResults: true - testResultsFiles: '**\TESTS-*.xml' + - task: Npm@1 + displayName: 'npm install' + inputs: + workingDir: src\Umbraco.Web.UI.Client + verbose: false - - task: PowerShell@1 - displayName: 'Prepare Packages & Zip' - inputs: - scriptType: inlineScript - inlineScript: | - Write-Host "Working folder: $pwd" - $ubuild = build\build.ps1 -get -continue + - task: gulp@0 + displayName: 'gulp build' + inputs: + gulpFile: src\Umbraco.Web.UI.Client\gulpfile.js + targets: build + workingDirectory: src\Umbraco.Web.UI.Client + publishJUnitResults: true + testResultsFiles: '**\TESTS-*.xml' - $ubuild.CompileUmbraco() - $ubuild.PreparePackages() - $ubuild.PackageZip() + - task: PowerShell@1 + displayName: 'Prepare Packages & Zip' + inputs: + scriptType: inlineScript + inlineScript: | + Write-Host "Working folder: $pwd" + $ubuild = build\build.ps1 -get -continue - - task: CopyFiles@2 - displayName: 'Copy Zip Files to Staging' - inputs: - SourceFolder: build.out - Contents: '*.zip' - TargetFolder: '$(build.artifactstagingdirectory)' - CleanTargetFolder: true + $ubuild.CompileUmbraco() + $ubuild.PreparePackages() + $ubuild.PackageZip() - - task: PublishBuildArtifacts@1 - displayName: 'Publish Zip Files' - inputs: - PathtoPublish: '$(build.artifactstagingdirectory)' - ArtifactName: zips + - task: CopyFiles@2 + displayName: 'Copy Zip Files to Staging' + inputs: + SourceFolder: build.out + Contents: '*.zip' + TargetFolder: '$(build.artifactstagingdirectory)' + CleanTargetFolder: true - - task: PowerShell@1 - displayName: 'Verify & Package NuGet' - inputs: - scriptType: inlineScript - inlineScript: | - Write-Host "Working folder: $pwd" - $ubuild = build\build.ps1 -get -continue + - task: PublishBuildArtifacts@1 + displayName: 'Publish Zip Files' + inputs: + PathtoPublish: '$(build.artifactstagingdirectory)' + ArtifactName: zips - $ubuild.VerifyNuGet() - $ubuild.PackageNuGet() + - task: PowerShell@1 + displayName: 'Verify & Package NuGet' + inputs: + scriptType: inlineScript + inlineScript: | + Write-Host "Working folder: $pwd" + $ubuild = build\build.ps1 -get -continue - - task: CopyFiles@2 - displayName: 'Copy NuPkg Files to Staging' - inputs: - SourceFolder: build.out - Contents: '*.nupkg' - TargetFolder: '$(build.artifactstagingdirectory)' - CleanTargetFolder: true + $ubuild.VerifyNuGet() + $ubuild.PackageNuGet() - - task: PublishBuildArtifacts@1 - displayName: 'Publish NuPkg Files' - inputs: - PathtoPublish: '$(build.artifactstagingdirectory)' - ArtifactName: nupkg + - task: CopyFiles@2 + displayName: 'Copy NuPkg Files to Staging' + inputs: + SourceFolder: build.out + Contents: '*.nupkg' + TargetFolder: '$(build.artifactstagingdirectory)' + CleanTargetFolder: true - - task: CopyFiles@2 - displayName: 'Copy Log Files to Staging' - inputs: - SourceFolder: build.tmp - Contents: '*.log' - TargetFolder: '$(build.artifactstagingdirectory)' - CleanTargetFolder: true - condition: succeededOrFailed() + - task: PublishBuildArtifacts@1 + displayName: 'Publish NuPkg Files' + inputs: + PathtoPublish: '$(build.artifactstagingdirectory)' + ArtifactName: nupkg - - task: PublishBuildArtifacts@1 - displayName: 'Publish Log Files' - inputs: - PathtoPublish: '$(build.artifactstagingdirectory)' - ArtifactName: logs - condition: succeededOrFailed() + - task: CopyFiles@2 + displayName: 'Copy Log Files to Staging' + inputs: + SourceFolder: build.tmp + Contents: '*.log' + TargetFolder: '$(build.artifactstagingdirectory)' + CleanTargetFolder: true + condition: succeededOrFailed() + + - task: PublishBuildArtifacts@1 + displayName: 'Publish Log Files' + inputs: + PathtoPublish: '$(build.artifactstagingdirectory)' + ArtifactName: logs + condition: succeededOrFailed() From 62771d7c087fdd46e43a2882a89e92c9b9cf0ebd Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 2 Dec 2020 10:09:30 +0100 Subject: [PATCH 40/41] added mac os x for unit tests Signed-off-by: Bjarke Berg --- build/azure-pipelines.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index acaaf75b70..bc348d3ade 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -11,6 +11,7 @@ variables: stages: - stage: Linux + dependsOn: [] # this removes the implicit dependency on previous stage and causes this to run in parallel jobs: - job: Unit_Tests @@ -30,6 +31,27 @@ stages: command: test projects: '**/*.Tests.UnitTests.csproj' +- stage: macOS_X + dependsOn: [] # this removes the implicit dependency on previous stage and causes this to run in parallel + jobs: + + - job: Unit_Tests + displayName: 'Unit Tests' + pool: + vmImage: 'macOS-latest' + steps: + + - task: UseDotNet@2 + displayName: 'Use .Net Core sdk 3.1.x' + inputs: + version: 3.1.x + + - task: DotNetCoreCLI@2 + displayName: 'dotnet test' + inputs: + command: test + projects: '**/*.Tests.UnitTests.csproj' + - stage: Windows dependsOn: [] # this removes the implicit dependency on previous stage and causes this to run in parallel From 3250231e02e10e3ce6711ae34c45793e2dc5cb2a Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 2 Dec 2020 10:10:42 +0100 Subject: [PATCH 41/41] Increased timeout for integration tests Signed-off-by: Bjarke Berg --- build/azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index bc348d3ade..f104012ae3 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -76,6 +76,7 @@ stages: - job: Integration_Tests + timeoutInMinutes: 120 displayName: 'Integration Tests' pool: vmImage: 'windows-latest'