diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index 2c4f942f3f58..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 @@ -748,4 +748,4 @@ extends: enableSigningValidation: false enableNugetValidation: false publishInstallersAndChecksums: true - publishAssetsImmediately: true + publishAssetsImmediately: true \ No newline at end of file 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/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/Shared/Project.cs b/src/ProjectTemplates/Shared/Project.cs index 771095b177de..308da1f9a8c8 100644 --- a/src/ProjectTemplates/Shared/Project.cs +++ b/src/ProjectTemplates/Shared/Project.cs @@ -426,7 +426,13 @@ internal async Task RunDotNetNewRawAsync(string arguments) public void Dispose() { - DeleteOutputDirectory(); + var doNotCleanUpTemplates = typeof(ProjectFactoryFixture).Assembly.GetCustomAttributes() + .Single(attribute => attribute.Key == "DoNotCleanUpTemplates") + .Value; + if (string.Equals(doNotCleanUpTemplates, "false", StringComparison.OrdinalIgnoreCase)) + { + DeleteOutputDirectory(); + } } public void DeleteOutputDirectory() diff --git a/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets b/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets index 0a886b420c11..4868bb529620 100644 --- a/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets +++ b/src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets @@ -20,6 +20,14 @@ <_Parameter1>ContinuousIntegrationBuild <_Parameter2>true + + <_Parameter1>DoNotCleanUpTemplates + <_Parameter2>true + + + <_Parameter1>DoNotCleanUpTemplates + <_Parameter2>false + 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..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,8 +7,11 @@ ProjectTemplates.Blazor.WebAssembly.Auth.Tests $(DefineConstants);XPLAT + true + 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..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,8 +7,11 @@ ProjectTemplates.Blazor.WebAssembly.Tests $(DefineConstants);XPLAT + true + 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..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,8 +7,11 @@ ProjectTemplates.Mvc.Tests $(DefineConstants);XPLAT + true + 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..df91970f0576 100644 --- a/src/ProjectTemplates/test/Templates.Tests/Templates.Tests.csproj +++ b/src/ProjectTemplates/test/Templates.Tests/Templates.Tests.csproj @@ -7,8 +7,11 @@ ProjectTemplates.Tests $(DefineConstants);XPLAT + true + true true + false false