From 5499af715c5bd1dad5480be23a19d30cd5ee4c87 Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Wed, 16 Apr 2025 09:18:12 -0700 Subject: [PATCH 01/18] Run windows local dev job in internal builds --- .azure/pipelines/ci.yml | 72 ++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index 2c4f942f3f58..16313517328e 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -632,42 +632,42 @@ extends: includeForks: true # Local development validation - - ${{ if in(variables['Build.Reason'], 'PullRequest', 'Manual') }}: - - template: .azure/pipelines/jobs/default-build.yml@self - parameters: - jobName: Local_Windows - jobDisplayName: 'Test: Windows local development validation' - agentOs: Windows - isAzDOTestingJob: true - timeoutInMinutes: 240 - steps: - - script: git submodule update --init - displayName: Update submodules - - script: ./restore.cmd - displayName: Run restore.cmd - - script: ./eng/build.cmd -all -noBuildJava -noBuildNodeJS - displayName: Build (No NodeJS) - - script: npm run build - displayName: Build JS - - script: ./eng/build.cmd -all -noBuildJava -pack -c Debug - displayName: Build (Debug) - - script: ./eng/build.cmd -all -noBuildJava -pack -c Release - displayName: Build (Release) - - script: ./src/ProjectTemplates/build.cmd - -test - -NoRestore - -NoBuild - -NoBuildDeps - -configuration Release - displayName: Run project template tests - - powershell: . ./activate.ps1; ./src/ProjectTemplates/scripts/Run-BlazorWeb-Locally.ps1 -Verbose - displayName: Run Blazor web app test script - - artifacts: - - name: Local_Windows_x64_Logs_Attempt_$(System.JobAttempt) - path: artifacts/log/ - publishOnError: true - includeForks: true + - template: .azure/pipelines/jobs/default-build.yml@self + parameters: + jobName: Local_Windows + jobDisplayName: 'Test: Windows local development validation' + agentOs: Windows + isAzDOTestingJob: true + timeoutInMinutes: 240 + steps: + - script: git submodule update --init + displayName: Update submodules + - script: ./restore.cmd + displayName: Run restore.cmd + - script: ./eng/build.cmd -all -noBuildJava -noBuildNodeJS "-WarnAsError:false" + displayName: Build (No NodeJS) + - script: npm run build + displayName: Build JS + - script: ./eng/build.cmd -all -noBuildJava -pack -c Debug + displayName: Build (Debug) + - script: ./eng/build.cmd -all -noBuildJava -pack -c Release + displayName: Build (Release) + - script: ./src/ProjectTemplates/build.cmd + -test + -NoRestore + -NoBuild + -NoBuildDeps + -configuration Release + -bl + displayName: Run project template tests + - powershell: . ./activate.ps1; ./src/ProjectTemplates/scripts/Run-BlazorWeb-Locally.ps1 -Verbose + displayName: Run Blazor web app test script + + artifacts: + - name: Local_Windows_x64_Logs_Attempt_$(System.JobAttempt) + path: artifacts/log/ + publishOnError: true + includeForks: true # Source build - template: /eng/common/templates-official/job/source-build.yml@self From 500d451084b689e5057178056c5824f7af70238b Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Wed, 16 Apr 2025 09:43:23 -0700 Subject: [PATCH 02/18] Fixaroonie --- .azure/pipelines/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index 16313517328e..7e256a5b32e7 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -644,7 +644,7 @@ extends: displayName: Update submodules - script: ./restore.cmd displayName: Run restore.cmd - - script: ./eng/build.cmd -all -noBuildJava -noBuildNodeJS "-WarnAsError:false" + - powershell: ./eng/build.ps1 -all -noBuildJava -noBuildNodeJS "-WarnAsError:false" displayName: Build (No NodeJS) - script: npm run build displayName: Build JS From 183261b9616aa230a74a85bd720c786797bd67bb Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Wed, 16 Apr 2025 10:54:36 -0700 Subject: [PATCH 03/18] Only on main --- .azure/pipelines/ci.yml | 73 +++++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index 7e256a5b32e7..f88e15c3bf99 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -632,42 +632,43 @@ extends: includeForks: true # Local development validation - - template: .azure/pipelines/jobs/default-build.yml@self - parameters: - jobName: Local_Windows - jobDisplayName: 'Test: Windows local development validation' - agentOs: Windows - isAzDOTestingJob: true - timeoutInMinutes: 240 - steps: - - script: git submodule update --init - displayName: Update submodules - - script: ./restore.cmd - displayName: Run restore.cmd - - powershell: ./eng/build.ps1 -all -noBuildJava -noBuildNodeJS "-WarnAsError:false" - displayName: Build (No NodeJS) - - script: npm run build - displayName: Build JS - - script: ./eng/build.cmd -all -noBuildJava -pack -c Debug - displayName: Build (Debug) - - script: ./eng/build.cmd -all -noBuildJava -pack -c Release - displayName: Build (Release) - - script: ./src/ProjectTemplates/build.cmd - -test - -NoRestore - -NoBuild - -NoBuildDeps - -configuration Release - -bl - displayName: Run project template tests - - powershell: . ./activate.ps1; ./src/ProjectTemplates/scripts/Run-BlazorWeb-Locally.ps1 -Verbose - displayName: Run Blazor web app test script - - artifacts: - - name: Local_Windows_x64_Logs_Attempt_$(System.JobAttempt) - path: artifacts/log/ - publishOnError: true - includeForks: true + - ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/main') }}: + - template: .azure/pipelines/jobs/default-build.yml@self + parameters: + jobName: Local_Windows + jobDisplayName: 'Test: Windows local development validation' + agentOs: Windows + isAzDOTestingJob: true + timeoutInMinutes: 240 + steps: + - script: git submodule update --init + displayName: Update submodules + - script: ./restore.cmd + displayName: Run restore.cmd + - powershell: ./eng/build.ps1 -all -noBuildJava -noBuildNodeJS "-WarnAsError:false" + displayName: Build (No NodeJS) + - script: npm run build + displayName: Build JS + - script: ./eng/build.cmd -all -noBuildJava -pack -c Debug + displayName: Build (Debug) + - script: ./eng/build.cmd -all -noBuildJava -pack -c Release + displayName: Build (Release) + - script: ./src/ProjectTemplates/build.cmd + -test + -NoRestore + -NoBuild + -NoBuildDeps + -configuration Release + -bl + displayName: Run project template tests + - powershell: . ./activate.ps1; ./src/ProjectTemplates/scripts/Run-BlazorWeb-Locally.ps1 -Verbose + displayName: Run Blazor web app test script + + artifacts: + - name: Local_Windows_x64_Logs_Attempt_$(System.JobAttempt) + path: artifacts/log/ + publishOnError: true + includeForks: true # Source build - template: /eng/common/templates-official/job/source-build.yml@self From 63995588080aa11c3640258f49c3b531fb034850 Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Wed, 16 Apr 2025 10:55:07 -0700 Subject: [PATCH 04/18] Never mind --- .azure/pipelines/ci.yml | 73 ++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 37 deletions(-) diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index f88e15c3bf99..7e256a5b32e7 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -632,43 +632,42 @@ extends: includeForks: true # Local development validation - - ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/main') }}: - - template: .azure/pipelines/jobs/default-build.yml@self - parameters: - jobName: Local_Windows - jobDisplayName: 'Test: Windows local development validation' - agentOs: Windows - isAzDOTestingJob: true - timeoutInMinutes: 240 - steps: - - script: git submodule update --init - displayName: Update submodules - - script: ./restore.cmd - displayName: Run restore.cmd - - powershell: ./eng/build.ps1 -all -noBuildJava -noBuildNodeJS "-WarnAsError:false" - displayName: Build (No NodeJS) - - script: npm run build - displayName: Build JS - - script: ./eng/build.cmd -all -noBuildJava -pack -c Debug - displayName: Build (Debug) - - script: ./eng/build.cmd -all -noBuildJava -pack -c Release - displayName: Build (Release) - - script: ./src/ProjectTemplates/build.cmd - -test - -NoRestore - -NoBuild - -NoBuildDeps - -configuration Release - -bl - displayName: Run project template tests - - powershell: . ./activate.ps1; ./src/ProjectTemplates/scripts/Run-BlazorWeb-Locally.ps1 -Verbose - displayName: Run Blazor web app test script - - artifacts: - - name: Local_Windows_x64_Logs_Attempt_$(System.JobAttempt) - path: artifacts/log/ - publishOnError: true - includeForks: true + - template: .azure/pipelines/jobs/default-build.yml@self + parameters: + jobName: Local_Windows + jobDisplayName: 'Test: Windows local development validation' + agentOs: Windows + isAzDOTestingJob: true + timeoutInMinutes: 240 + steps: + - script: git submodule update --init + displayName: Update submodules + - script: ./restore.cmd + displayName: Run restore.cmd + - powershell: ./eng/build.ps1 -all -noBuildJava -noBuildNodeJS "-WarnAsError:false" + displayName: Build (No NodeJS) + - script: npm run build + displayName: Build JS + - script: ./eng/build.cmd -all -noBuildJava -pack -c Debug + displayName: Build (Debug) + - script: ./eng/build.cmd -all -noBuildJava -pack -c Release + displayName: Build (Release) + - script: ./src/ProjectTemplates/build.cmd + -test + -NoRestore + -NoBuild + -NoBuildDeps + -configuration Release + -bl + displayName: Run project template tests + - powershell: . ./activate.ps1; ./src/ProjectTemplates/scripts/Run-BlazorWeb-Locally.ps1 -Verbose + displayName: Run Blazor web app test script + + artifacts: + - name: Local_Windows_x64_Logs_Attempt_$(System.JobAttempt) + path: artifacts/log/ + publishOnError: true + includeForks: true # Source build - template: /eng/common/templates-official/job/source-build.yml@self From c1f59b50e21f804a377e70d59459b59ca042440f Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Tue, 22 Apr 2025 14:30:03 -0700 Subject: [PATCH 05/18] Don't delete project template content in CI --- src/ProjectTemplates/Shared/Project.cs | 9 ++++++++- .../TestInfrastructure/PrepareForTest.targets | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/ProjectTemplates/Shared/Project.cs b/src/ProjectTemplates/Shared/Project.cs index 771095b177de..b1b2d6ee5e56 100644 --- a/src/ProjectTemplates/Shared/Project.cs +++ b/src/ProjectTemplates/Shared/Project.cs @@ -45,6 +45,10 @@ public static string ArtifactsLogDir .Value : Environment.GetEnvironmentVariable("DotNetEfFullPath"); + private bool ContinuousIntegrationBuild => (string.Equals(typeof(ProjectFactoryFixture).Assembly.GetCustomAttributes() + .Single(attribute => attribute.Key == "ContinuousIntegrationBuild") + .Value), "true", StringComparison.OrdinalIgnoreCase); + public string ProjectName { get; set; } public string ProjectArguments { get; set; } public string ProjectGuid { get; set; } @@ -426,7 +430,10 @@ internal async Task RunDotNetNewRawAsync(string arguments) public void Dispose() { - DeleteOutputDirectory(); + if (ContinuousIntegrationBuild) + { + DeleteOutputDirectory(); + } } public void DeleteOutputDirectory() diff --git a/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets b/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets index 0a886b420c11..f022a4a20951 100644 --- a/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets +++ b/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets @@ -20,6 +20,10 @@ <_Parameter1>ContinuousIntegrationBuild <_Parameter2>true + + <_Parameter1>ContinuousIntegrationBuild + <_Parameter2>false + From 1b31e6f5de8f8e66a6659ad70a9d852348f3d94a Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Tue, 22 Apr 2025 14:30:49 -0700 Subject: [PATCH 06/18] -ci --- .azure/pipelines/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index 7e256a5b32e7..5589223cb358 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -659,6 +659,7 @@ extends: -NoBuildDeps -configuration Release -bl + -ci displayName: Run project template tests - powershell: . ./activate.ps1; ./src/ProjectTemplates/scripts/Run-BlazorWeb-Locally.ps1 -Verbose displayName: Run Blazor web app test script From ba92489e1f7950887cac7307fd2b101719844cbf Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Tue, 22 Apr 2025 14:55:18 -0700 Subject: [PATCH 07/18] Static --- src/ProjectTemplates/Shared/Project.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ProjectTemplates/Shared/Project.cs b/src/ProjectTemplates/Shared/Project.cs index b1b2d6ee5e56..ff833d6d050c 100644 --- a/src/ProjectTemplates/Shared/Project.cs +++ b/src/ProjectTemplates/Shared/Project.cs @@ -45,7 +45,7 @@ public static string ArtifactsLogDir .Value : Environment.GetEnvironmentVariable("DotNetEfFullPath"); - private bool ContinuousIntegrationBuild => (string.Equals(typeof(ProjectFactoryFixture).Assembly.GetCustomAttributes() + private static bool ContinuousIntegrationBuild => (string.Equals(typeof(ProjectFactoryFixture).Assembly.GetCustomAttributes() .Single(attribute => attribute.Key == "ContinuousIntegrationBuild") .Value), "true", StringComparison.OrdinalIgnoreCase); From f9c8ccceb9d90813a8847efedef5a53b48dbbb61 Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Tue, 22 Apr 2025 15:22:08 -0700 Subject: [PATCH 08/18] Try this --- src/ProjectTemplates/Shared/Project.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ProjectTemplates/Shared/Project.cs b/src/ProjectTemplates/Shared/Project.cs index ff833d6d050c..1e19f044e2b5 100644 --- a/src/ProjectTemplates/Shared/Project.cs +++ b/src/ProjectTemplates/Shared/Project.cs @@ -45,10 +45,6 @@ public static string ArtifactsLogDir .Value : Environment.GetEnvironmentVariable("DotNetEfFullPath"); - private static bool ContinuousIntegrationBuild => (string.Equals(typeof(ProjectFactoryFixture).Assembly.GetCustomAttributes() - .Single(attribute => attribute.Key == "ContinuousIntegrationBuild") - .Value), "true", StringComparison.OrdinalIgnoreCase); - public string ProjectName { get; set; } public string ProjectArguments { get; set; } public string ProjectGuid { get; set; } @@ -430,7 +426,10 @@ internal async Task RunDotNetNewRawAsync(string arguments) public void Dispose() { - if (ContinuousIntegrationBuild) + var continuousIntegrationBuild = typeof(ProjectFactoryFixture).Assembly.GetCustomAttributes() + .Single(attribute => attribute.Key == "ContinuousIntegrationBuild") + .Value; + if (string.Equals(continuousIntegrationBuild, "true", StringComparison.OrdinalIgnoreCase)) { DeleteOutputDirectory(); } From ee01182991d795109c694559ed5ae1bcd5a23d22 Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Tue, 22 Apr 2025 17:19:06 -0700 Subject: [PATCH 09/18] NoBuildRepoTasks --- .azure/pipelines/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index 5589223cb358..9685ee29dc08 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -657,6 +657,7 @@ extends: -NoRestore -NoBuild -NoBuildDeps + -NoBuildRepoTasks -configuration Release -bl -ci From 95ed98972d777546e3fb54b961f4254e62fcf26f Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Tue, 22 Apr 2025 18:20:02 -0700 Subject: [PATCH 10/18] Maybe this --- .azure/pipelines/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index 9685ee29dc08..59f31afcf62e 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -657,10 +657,9 @@ extends: -NoRestore -NoBuild -NoBuildDeps - -NoBuildRepoTasks -configuration Release -bl - -ci + /p:ContinuousIntegrationBuild=true displayName: Run project template tests - powershell: . ./activate.ps1; ./src/ProjectTemplates/scripts/Run-BlazorWeb-Locally.ps1 -Verbose displayName: Run Blazor web app test script From 610e5b310916539b63bb11e251da02ff31fc5d0f Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Tue, 22 Apr 2025 20:35:12 -0700 Subject: [PATCH 11/18] Message --- src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets b/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets index f022a4a20951..e616b1ea6337 100644 --- a/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets +++ b/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets @@ -97,6 +97,8 @@ get cached results and changes show up. --> + + <_ExistingFilesFromLastRun Include="$(TestTemplateCreationFolder)**\*" /> From 73584740e2370752518e04feefd3b84e6835f7e5 Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Wed, 23 Apr 2025 08:24:48 -0700 Subject: [PATCH 12/18] This should work --- .azure/pipelines/ci.yml | 4 ++-- src/ProjectTemplates/Shared/Project.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index 59f31afcf62e..4eaa78fed6f9 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -648,9 +648,9 @@ extends: displayName: Build (No NodeJS) - script: npm run build displayName: Build JS - - script: ./eng/build.cmd -all -noBuildJava -pack -c Debug + - script: ./eng/build.cmd -all -noBuildJava -pack -c Debug /p:ContinuousIntegrationBuild=true displayName: Build (Debug) - - script: ./eng/build.cmd -all -noBuildJava -pack -c Release + - script: ./eng/build.cmd -all -noBuildJava -pack -c Release /p:ContinuousIntegrationBuild=true displayName: Build (Release) - script: ./src/ProjectTemplates/build.cmd -test diff --git a/src/ProjectTemplates/Shared/Project.cs b/src/ProjectTemplates/Shared/Project.cs index 1e19f044e2b5..5a720d54aaf1 100644 --- a/src/ProjectTemplates/Shared/Project.cs +++ b/src/ProjectTemplates/Shared/Project.cs @@ -429,7 +429,7 @@ public void Dispose() var continuousIntegrationBuild = typeof(ProjectFactoryFixture).Assembly.GetCustomAttributes() .Single(attribute => attribute.Key == "ContinuousIntegrationBuild") .Value; - if (string.Equals(continuousIntegrationBuild, "true", StringComparison.OrdinalIgnoreCase)) + if (string.Equals(continuousIntegrationBuild, "false", StringComparison.OrdinalIgnoreCase)) { DeleteOutputDirectory(); } From 0fb5caa77a588259cf58a8f7dae905f627a84b43 Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Wed, 23 Apr 2025 08:25:19 -0700 Subject: [PATCH 13/18] This shouldn't work --- src/ProjectTemplates/Shared/Project.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ProjectTemplates/Shared/Project.cs b/src/ProjectTemplates/Shared/Project.cs index 5a720d54aaf1..1e19f044e2b5 100644 --- a/src/ProjectTemplates/Shared/Project.cs +++ b/src/ProjectTemplates/Shared/Project.cs @@ -429,7 +429,7 @@ public void Dispose() var continuousIntegrationBuild = typeof(ProjectFactoryFixture).Assembly.GetCustomAttributes() .Single(attribute => attribute.Key == "ContinuousIntegrationBuild") .Value; - if (string.Equals(continuousIntegrationBuild, "false", StringComparison.OrdinalIgnoreCase)) + if (string.Equals(continuousIntegrationBuild, "true", StringComparison.OrdinalIgnoreCase)) { DeleteOutputDirectory(); } From 806d7255037154cfe8660c8bf44c1ee400db859b Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Wed, 23 Apr 2025 11:58:20 -0700 Subject: [PATCH 14/18] Different approach --- .azure/pipelines/ci.yml | 123 +++++++++--------- src/ProjectTemplates/Shared/Project.cs | 6 +- .../TestInfrastructure/PrepareForTest.targets | 8 +- 3 files changed, 70 insertions(+), 67 deletions(-) diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index 4eaa78fed6f9..173de225293a 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -534,32 +534,32 @@ extends: parameters: inputName: Linux_musl_arm64 + - template: .azure/pipelines/jobs/default-build.yml@self + parameters: + jobName: Windows_Test + jobDisplayName: "Test: Windows Server x64" + agentOs: Windows + isAzDOTestingJob: true + # Just uploading artifacts/logs/ files can take 15 minutes. Doubling the cancel timeout for this job. + cancelTimeoutInMinutes: 30 + buildArgs: -all -pack -test -binaryLog /p:SkipHelixReadyTests=true /p:SkipIISNewHandlerTests=true /p:SkipIISTests=true + /p:SkipIISExpressTests=true /p:SkipIISNewShimTests=true /p:RunBlazorPlaywrightTemplateTests=true /p:DoNotCleanUpTemplates=true + $(_InternalRuntimeDownloadArgs) + beforeBuild: + - powershell: "& ./src/Servers/IIS/tools/UpdateIISExpressCertificate.ps1; & ./src/Servers/IIS/tools/update_schema.ps1" + displayName: Setup IISExpress test certificates and schema + artifacts: + - name: Windows_Test_Logs_Attempt_$(System.JobAttempt) + path: artifacts/log/ + publishOnError: true + includeForks: true + - name: Windows_Test_Results_Attempt_$(System.JobAttempt) + path: artifacts/TestResults/ + publishOnError: true + includeForks: true + - ${{ if and(ne(parameters.skipTests, 'true'), in(variables['Build.Reason'], 'PullRequest', 'Manual')) }}: # Test jobs - - template: .azure/pipelines/jobs/default-build.yml@self - parameters: - jobName: Windows_Test - jobDisplayName: "Test: Windows Server x64" - agentOs: Windows - isAzDOTestingJob: true - # Just uploading artifacts/logs/ files can take 15 minutes. Doubling the cancel timeout for this job. - cancelTimeoutInMinutes: 30 - buildArgs: -all -pack -test -binaryLog /p:SkipHelixReadyTests=true /p:SkipIISNewHandlerTests=true /p:SkipIISTests=true - /p:SkipIISExpressTests=true /p:SkipIISNewShimTests=true /p:RunTemplateTests=false /p:RunBlazorPlaywrightTemplateTests=true - $(_InternalRuntimeDownloadArgs) - beforeBuild: - - powershell: "& ./src/Servers/IIS/tools/UpdateIISExpressCertificate.ps1; & ./src/Servers/IIS/tools/update_schema.ps1" - displayName: Setup IISExpress test certificates and schema - artifacts: - - name: Windows_Test_Logs_Attempt_$(System.JobAttempt) - path: artifacts/log/ - publishOnError: true - includeForks: true - - name: Windows_Test_Results_Attempt_$(System.JobAttempt) - path: artifacts/TestResults/ - publishOnError: true - includeForks: true - - template: .azure/pipelines/jobs/default-build.yml@self parameters: jobName: MacOS_Test @@ -632,43 +632,42 @@ extends: includeForks: true # Local development validation - - template: .azure/pipelines/jobs/default-build.yml@self - parameters: - jobName: Local_Windows - jobDisplayName: 'Test: Windows local development validation' - agentOs: Windows - isAzDOTestingJob: true - timeoutInMinutes: 240 - steps: - - script: git submodule update --init - displayName: Update submodules - - script: ./restore.cmd - displayName: Run restore.cmd - - powershell: ./eng/build.ps1 -all -noBuildJava -noBuildNodeJS "-WarnAsError:false" - displayName: Build (No NodeJS) - - script: npm run build - displayName: Build JS - - script: ./eng/build.cmd -all -noBuildJava -pack -c Debug /p:ContinuousIntegrationBuild=true - displayName: Build (Debug) - - script: ./eng/build.cmd -all -noBuildJava -pack -c Release /p:ContinuousIntegrationBuild=true - displayName: Build (Release) - - script: ./src/ProjectTemplates/build.cmd - -test - -NoRestore - -NoBuild - -NoBuildDeps - -configuration Release - -bl - /p:ContinuousIntegrationBuild=true - displayName: Run project template tests - - powershell: . ./activate.ps1; ./src/ProjectTemplates/scripts/Run-BlazorWeb-Locally.ps1 -Verbose - displayName: Run Blazor web app test script - - artifacts: - - name: Local_Windows_x64_Logs_Attempt_$(System.JobAttempt) - path: artifacts/log/ - publishOnError: true - includeForks: true + - ${{ if in(variables['Build.Reason'], 'PullRequest', 'Manual') }}: + - template: .azure/pipelines/jobs/default-build.yml@self + parameters: + jobName: Local_Windows + jobDisplayName: 'Test: Windows local development validation' + agentOs: Windows + isAzDOTestingJob: true + timeoutInMinutes: 240 + steps: + - script: git submodule update --init + displayName: Update submodules + - script: ./restore.cmd + displayName: Run restore.cmd + - script: ./eng/build.cmd -all -noBuildJava -noBuildNodeJS + displayName: Build (No NodeJS) + - script: npm run build + displayName: Build JS + - script: ./eng/build.cmd -all -noBuildJava -pack -c Debug + displayName: Build (Debug) + - script: ./eng/build.cmd -all -noBuildJava -pack -c Release + displayName: Build (Release) + - script: ./src/ProjectTemplates/build.cmd + -test + -NoRestore + -NoBuild + -NoBuildDeps + -configuration Release + displayName: Run project template tests + - powershell: . ./activate.ps1; ./src/ProjectTemplates/scripts/Run-BlazorWeb-Locally.ps1 -Verbose + displayName: Run Blazor web app test script + + artifacts: + - name: Local_Windows_x64_Logs_Attempt_$(System.JobAttempt) + path: artifacts/log/ + publishOnError: true + includeForks: true # Source build - template: /eng/common/templates-official/job/source-build.yml@self @@ -749,4 +748,4 @@ extends: enableSigningValidation: false enableNugetValidation: false publishInstallersAndChecksums: true - publishAssetsImmediately: true + publishAssetsImmediately: true \ No newline at end of file diff --git a/src/ProjectTemplates/Shared/Project.cs b/src/ProjectTemplates/Shared/Project.cs index 1e19f044e2b5..308da1f9a8c8 100644 --- a/src/ProjectTemplates/Shared/Project.cs +++ b/src/ProjectTemplates/Shared/Project.cs @@ -426,10 +426,10 @@ internal async Task RunDotNetNewRawAsync(string arguments) public void Dispose() { - var continuousIntegrationBuild = typeof(ProjectFactoryFixture).Assembly.GetCustomAttributes() - .Single(attribute => attribute.Key == "ContinuousIntegrationBuild") + var doNotCleanUpTemplates = typeof(ProjectFactoryFixture).Assembly.GetCustomAttributes() + .Single(attribute => attribute.Key == "DoNotCleanUpTemplates") .Value; - if (string.Equals(continuousIntegrationBuild, "true", StringComparison.OrdinalIgnoreCase)) + if (string.Equals(doNotCleanUpTemplates, "false", StringComparison.OrdinalIgnoreCase)) { DeleteOutputDirectory(); } diff --git a/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets b/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets index e616b1ea6337..05d2533ce412 100644 --- a/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets +++ b/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets @@ -20,8 +20,12 @@ <_Parameter1>ContinuousIntegrationBuild <_Parameter2>true - - <_Parameter1>ContinuousIntegrationBuild + + <_Parameter1>DoNotCleanUpTemplates + <_Parameter2>true + + + <_Parameter1>DoNotCleanUpTemplates <_Parameter2>false From 8c4531abef479f08edc33921a30dd4ba04606109 Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Wed, 23 Apr 2025 12:34:29 -0700 Subject: [PATCH 15/18] Fix print --- src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets b/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets index 05d2533ce412..3a22b31f2f4a 100644 --- a/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets +++ b/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets @@ -101,7 +101,7 @@ get cached results and changes show up. --> - + <_ExistingFilesFromLastRun Include="$(TestTemplateCreationFolder)**\*" /> From 9a8e62a8817a47bea34c60edf94abf09f23082e0 Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Wed, 23 Apr 2025 13:28:52 -0700 Subject: [PATCH 16/18] This oughta do er --- Directory.Build.targets | 2 +- .../test/Templates.Blazor.Tests/Templates.Blazor.Tests.csproj | 1 + .../Templates.Blazor.WebAssembly.Auth.Tests.csproj | 1 + .../Templates.Blazor.WebAssembly.Tests.csproj | 1 + .../test/Templates.Mvc.Tests/Templates.Mvc.Tests.csproj | 1 + .../test/Templates.Tests/Templates.Tests.csproj | 1 + 6 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index df1a893306cf..a2245ab43544 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -119,7 +119,7 @@ false true - true + true diff --git a/src/ProjectTemplates/test/Templates.Blazor.Tests/Templates.Blazor.Tests.csproj b/src/ProjectTemplates/test/Templates.Blazor.Tests/Templates.Blazor.Tests.csproj index d4d021fd72f6..64c4a8639c41 100644 --- a/src/ProjectTemplates/test/Templates.Blazor.Tests/Templates.Blazor.Tests.csproj +++ b/src/ProjectTemplates/test/Templates.Blazor.Tests/Templates.Blazor.Tests.csproj @@ -9,6 +9,7 @@ true $(RunTemplateTests) true + false false diff --git a/src/ProjectTemplates/test/Templates.Blazor.WebAssembly.Auth.Tests/Templates.Blazor.WebAssembly.Auth.Tests.csproj b/src/ProjectTemplates/test/Templates.Blazor.WebAssembly.Auth.Tests/Templates.Blazor.WebAssembly.Auth.Tests.csproj index 3e35764237f4..e5a4e375c752 100644 --- a/src/ProjectTemplates/test/Templates.Blazor.WebAssembly.Auth.Tests/Templates.Blazor.WebAssembly.Auth.Tests.csproj +++ b/src/ProjectTemplates/test/Templates.Blazor.WebAssembly.Auth.Tests/Templates.Blazor.WebAssembly.Auth.Tests.csproj @@ -9,6 +9,7 @@ true true + false false diff --git a/src/ProjectTemplates/test/Templates.Blazor.WebAssembly.Tests/Templates.Blazor.WebAssembly.Tests.csproj b/src/ProjectTemplates/test/Templates.Blazor.WebAssembly.Tests/Templates.Blazor.WebAssembly.Tests.csproj index b8527a427b7e..4f438d41d092 100644 --- a/src/ProjectTemplates/test/Templates.Blazor.WebAssembly.Tests/Templates.Blazor.WebAssembly.Tests.csproj +++ b/src/ProjectTemplates/test/Templates.Blazor.WebAssembly.Tests/Templates.Blazor.WebAssembly.Tests.csproj @@ -9,6 +9,7 @@ true true + false false diff --git a/src/ProjectTemplates/test/Templates.Mvc.Tests/Templates.Mvc.Tests.csproj b/src/ProjectTemplates/test/Templates.Mvc.Tests/Templates.Mvc.Tests.csproj index c48d5fd348a3..5a597e7d331a 100644 --- a/src/ProjectTemplates/test/Templates.Mvc.Tests/Templates.Mvc.Tests.csproj +++ b/src/ProjectTemplates/test/Templates.Mvc.Tests/Templates.Mvc.Tests.csproj @@ -9,6 +9,7 @@ true true + false false diff --git a/src/ProjectTemplates/test/Templates.Tests/Templates.Tests.csproj b/src/ProjectTemplates/test/Templates.Tests/Templates.Tests.csproj index c38fecb2c615..397095444cb9 100644 --- a/src/ProjectTemplates/test/Templates.Tests/Templates.Tests.csproj +++ b/src/ProjectTemplates/test/Templates.Tests/Templates.Tests.csproj @@ -9,6 +9,7 @@ true true + false false From e0d3dca3a7b08efcdb0898b029764f2e870a6ac6 Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Wed, 23 Apr 2025 14:29:15 -0700 Subject: [PATCH 17/18] Delayed --- eng/RequiresDelayedBuildProjects.props | 4 ++++ .../Templates.Blazor.WebAssembly.Auth.Tests.csproj | 2 ++ .../Templates.Blazor.WebAssembly.Tests.csproj | 2 ++ .../test/Templates.Mvc.Tests/Templates.Mvc.Tests.csproj | 2 ++ .../test/Templates.Tests/Templates.Tests.csproj | 2 ++ 5 files changed, 12 insertions(+) diff --git a/eng/RequiresDelayedBuildProjects.props b/eng/RequiresDelayedBuildProjects.props index 1a771e0d5e74..80b709a0986f 100644 --- a/eng/RequiresDelayedBuildProjects.props +++ b/eng/RequiresDelayedBuildProjects.props @@ -22,6 +22,10 @@ + + + + diff --git a/src/ProjectTemplates/test/Templates.Blazor.WebAssembly.Auth.Tests/Templates.Blazor.WebAssembly.Auth.Tests.csproj b/src/ProjectTemplates/test/Templates.Blazor.WebAssembly.Auth.Tests/Templates.Blazor.WebAssembly.Auth.Tests.csproj index e5a4e375c752..25491823a21d 100644 --- a/src/ProjectTemplates/test/Templates.Blazor.WebAssembly.Auth.Tests/Templates.Blazor.WebAssembly.Auth.Tests.csproj +++ b/src/ProjectTemplates/test/Templates.Blazor.WebAssembly.Auth.Tests/Templates.Blazor.WebAssembly.Auth.Tests.csproj @@ -7,6 +7,8 @@ ProjectTemplates.Blazor.WebAssembly.Auth.Tests $(DefineConstants);XPLAT + true + true true false diff --git a/src/ProjectTemplates/test/Templates.Blazor.WebAssembly.Tests/Templates.Blazor.WebAssembly.Tests.csproj b/src/ProjectTemplates/test/Templates.Blazor.WebAssembly.Tests/Templates.Blazor.WebAssembly.Tests.csproj index 4f438d41d092..15bb53c98209 100644 --- a/src/ProjectTemplates/test/Templates.Blazor.WebAssembly.Tests/Templates.Blazor.WebAssembly.Tests.csproj +++ b/src/ProjectTemplates/test/Templates.Blazor.WebAssembly.Tests/Templates.Blazor.WebAssembly.Tests.csproj @@ -7,6 +7,8 @@ ProjectTemplates.Blazor.WebAssembly.Tests $(DefineConstants);XPLAT + true + true true false diff --git a/src/ProjectTemplates/test/Templates.Mvc.Tests/Templates.Mvc.Tests.csproj b/src/ProjectTemplates/test/Templates.Mvc.Tests/Templates.Mvc.Tests.csproj index 5a597e7d331a..e9371e45210f 100644 --- a/src/ProjectTemplates/test/Templates.Mvc.Tests/Templates.Mvc.Tests.csproj +++ b/src/ProjectTemplates/test/Templates.Mvc.Tests/Templates.Mvc.Tests.csproj @@ -7,6 +7,8 @@ ProjectTemplates.Mvc.Tests $(DefineConstants);XPLAT + true + true true false diff --git a/src/ProjectTemplates/test/Templates.Tests/Templates.Tests.csproj b/src/ProjectTemplates/test/Templates.Tests/Templates.Tests.csproj index 397095444cb9..df91970f0576 100644 --- a/src/ProjectTemplates/test/Templates.Tests/Templates.Tests.csproj +++ b/src/ProjectTemplates/test/Templates.Tests/Templates.Tests.csproj @@ -7,6 +7,8 @@ ProjectTemplates.Tests $(DefineConstants);XPLAT + true + true true false From 95d324a22f31c7989ae8c10cec4b1b59c5d32c1a Mon Sep 17 00:00:00 2001 From: wtgodbe Date: Wed, 23 Apr 2025 15:59:16 -0700 Subject: [PATCH 18/18] No message --- src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets b/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets index 3a22b31f2f4a..4868bb529620 100644 --- a/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets +++ b/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets @@ -101,8 +101,6 @@ get cached results and changes show up. --> - - <_ExistingFilesFromLastRun Include="$(TestTemplateCreationFolder)**\*" />