Skip to content

Commit fac11a9

Browse files
authored
Build Windows local test job in official builds (#61519)
* Run windows local dev job in internal builds * Fixaroonie * Only on main * Never mind * Don't delete project template content in CI * -ci * Static * Try this * NoBuildRepoTasks * Maybe this * Message * This should work * This shouldn't work * Different approach * Fix print * This oughta do er * Delayed * No message
1 parent d7315db commit fac11a9

File tree

10 files changed

+58
-27
lines changed

10 files changed

+58
-27
lines changed

.azure/pipelines/ci.yml

+25-25
Original file line numberDiff line numberDiff line change
@@ -534,32 +534,32 @@ extends:
534534
parameters:
535535
inputName: Linux_musl_arm64
536536

537+
- template: .azure/pipelines/jobs/default-build.yml@self
538+
parameters:
539+
jobName: Windows_Test
540+
jobDisplayName: "Test: Windows Server x64"
541+
agentOs: Windows
542+
isAzDOTestingJob: true
543+
# Just uploading artifacts/logs/ files can take 15 minutes. Doubling the cancel timeout for this job.
544+
cancelTimeoutInMinutes: 30
545+
buildArgs: -all -pack -test -binaryLog /p:SkipHelixReadyTests=true /p:SkipIISNewHandlerTests=true /p:SkipIISTests=true
546+
/p:SkipIISExpressTests=true /p:SkipIISNewShimTests=true /p:RunBlazorPlaywrightTemplateTests=true /p:DoNotCleanUpTemplates=true
547+
$(_InternalRuntimeDownloadArgs)
548+
beforeBuild:
549+
- powershell: "& ./src/Servers/IIS/tools/UpdateIISExpressCertificate.ps1; & ./src/Servers/IIS/tools/update_schema.ps1"
550+
displayName: Setup IISExpress test certificates and schema
551+
artifacts:
552+
- name: Windows_Test_Logs_Attempt_$(System.JobAttempt)
553+
path: artifacts/log/
554+
publishOnError: true
555+
includeForks: true
556+
- name: Windows_Test_Results_Attempt_$(System.JobAttempt)
557+
path: artifacts/TestResults/
558+
publishOnError: true
559+
includeForks: true
560+
537561
- ${{ if and(ne(parameters.skipTests, 'true'), in(variables['Build.Reason'], 'PullRequest', 'Manual')) }}:
538562
# Test jobs
539-
- template: .azure/pipelines/jobs/default-build.yml@self
540-
parameters:
541-
jobName: Windows_Test
542-
jobDisplayName: "Test: Windows Server x64"
543-
agentOs: Windows
544-
isAzDOTestingJob: true
545-
# Just uploading artifacts/logs/ files can take 15 minutes. Doubling the cancel timeout for this job.
546-
cancelTimeoutInMinutes: 30
547-
buildArgs: -all -pack -test -binaryLog /p:SkipHelixReadyTests=true /p:SkipIISNewHandlerTests=true /p:SkipIISTests=true
548-
/p:SkipIISExpressTests=true /p:SkipIISNewShimTests=true /p:RunTemplateTests=false /p:RunBlazorPlaywrightTemplateTests=true
549-
$(_InternalRuntimeDownloadArgs)
550-
beforeBuild:
551-
- powershell: "& ./src/Servers/IIS/tools/UpdateIISExpressCertificate.ps1; & ./src/Servers/IIS/tools/update_schema.ps1"
552-
displayName: Setup IISExpress test certificates and schema
553-
artifacts:
554-
- name: Windows_Test_Logs_Attempt_$(System.JobAttempt)
555-
path: artifacts/log/
556-
publishOnError: true
557-
includeForks: true
558-
- name: Windows_Test_Results_Attempt_$(System.JobAttempt)
559-
path: artifacts/TestResults/
560-
publishOnError: true
561-
includeForks: true
562-
563563
- template: .azure/pipelines/jobs/default-build.yml@self
564564
parameters:
565565
jobName: MacOS_Test
@@ -748,4 +748,4 @@ extends:
748748
enableSigningValidation: false
749749
enableNugetValidation: false
750750
publishInstallersAndChecksums: true
751-
publishAssetsImmediately: true
751+
publishAssetsImmediately: true

Directory.Build.targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
<IsPackable Condition="'$(IsPackable)' == '' ">false</IsPackable>
120120

121121
<BuildHelixPayload Condition="'$(BuildHelixPayload)' == '' AND $(IsTestProject) ">true</BuildHelixPayload>
122-
<SkipTests Condition="'$(SkipHelixReadyTests)' == 'true' AND '$(BuildHelixPayload)' == 'true'">true</SkipTests>
122+
<SkipTests Condition="'$(SkipTests)' == '' AND '$(SkipHelixReadyTests)' == 'true' AND '$(BuildHelixPayload)' == 'true'">true</SkipTests>
123123
</PropertyGroup>
124124

125125
<PropertyGroup>

eng/RequiresDelayedBuildProjects.props

+4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
<RequiresDelayedBuild Include="$(RepoRoot)src\Grpc\JsonTranscoding\test\testassets\Sandbox\Sandbox.csproj" />
2323
<RequiresDelayedBuild Include="$(RepoRoot)src\OpenApi\test\Microsoft.AspNetCore.OpenApi.NativeAotTests\Microsoft.AspNetCore.OpenApi.NativeAotTests.proj" />
2424
<RequiresDelayedBuild Include="$(RepoRoot)src\ProjectTemplates\test\Templates.Blazor.Tests\Templates.Blazor.Tests.csproj" />
25+
<RequiresDelayedBuild Include="$(RepoRoot)src\ProjectTemplates\test\Templates.Blazor.WebAssembly.Auth.Tests\Templates.Blazor.WebAssembly.Auth.Tests.csproj" />
26+
<RequiresDelayedBuild Include="$(RepoRoot)src\ProjectTemplates\test\Templates.Blazor.WebAssembly.Tests\Templates.Blazor.WebAssembly.Tests.csproj" />
27+
<RequiresDelayedBuild Include="$(RepoRoot)src\ProjectTemplates\test\Templates.Mvc.Tests\Templates.Mvc.Tests.csproj" />
28+
<RequiresDelayedBuild Include="$(RepoRoot)src\ProjectTemplates\test\Templates.Tests\Templates.Tests.csproj" />
2529
<RequiresDelayedBuild Include="$(RepoRoot)src\SignalR\server\SignalR\test\Microsoft.AspNetCore.SignalR.TrimmingTests\Microsoft.AspNetCore.SignalR.TrimmingTests.proj" />
2630
<RequiresDelayedBuild Include="$(RepoRoot)eng\Npm.Workspace.FunctionalTests.nodeproj" />
2731
</ItemGroup>

src/ProjectTemplates/Shared/Project.cs

+7-1
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,13 @@ internal async Task RunDotNetNewRawAsync(string arguments)
426426

427427
public void Dispose()
428428
{
429-
DeleteOutputDirectory();
429+
var doNotCleanUpTemplates = typeof(ProjectFactoryFixture).Assembly.GetCustomAttributes<AssemblyMetadataAttribute>()
430+
.Single(attribute => attribute.Key == "DoNotCleanUpTemplates")
431+
.Value;
432+
if (string.Equals(doNotCleanUpTemplates, "false", StringComparison.OrdinalIgnoreCase))
433+
{
434+
DeleteOutputDirectory();
435+
}
430436
}
431437

432438
public void DeleteOutputDirectory()

src/ProjectTemplates/TestInfrastructure/PrepareForTest.targets

+8
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@
2020
<_Parameter1>ContinuousIntegrationBuild</_Parameter1>
2121
<_Parameter2>true</_Parameter2>
2222
</AssemblyAttribute>
23+
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition="'$(DoNotCleanUpTemplates)' == 'true'">
24+
<_Parameter1>DoNotCleanUpTemplates</_Parameter1>
25+
<_Parameter2>true</_Parameter2>
26+
</AssemblyAttribute>
27+
<AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition="'$(DoNotCleanUpTemplates)' != 'true'">
28+
<_Parameter1>DoNotCleanUpTemplates</_Parameter1>
29+
<_Parameter2>false</_Parameter2>
30+
</AssemblyAttribute>
2331
</ItemGroup>
2432

2533
<Target Name="GenerateTesDevCert" BeforeTargets="AssignTargetPaths">

src/ProjectTemplates/test/Templates.Blazor.Tests/Templates.Blazor.Tests.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<RunTemplateTests Condition="'$(RunTemplateTests)' == ''">true</RunTemplateTests>
1010
<RunBlazorPlaywrightTemplateTests Condition="'$(RunBlazorPlaywrightTemplateTests)' == ''">$(RunTemplateTests)</RunBlazorPlaywrightTemplateTests>
1111
<SkipTests Condition="'$(RunBlazorPlaywrightTemplateTests)' != 'true'">true</SkipTests>
12+
<SkipTests Condition="'$(RunBlazorPlaywrightTemplateTests)' == 'true'">false</SkipTests>
1213
<BuildHelixPayload Condition="'$(RunBlazorPlaywrightTemplateTests)' != 'true'">false</BuildHelixPayload>
1314

1415
<BaseOutputPath />

src/ProjectTemplates/test/Templates.Blazor.WebAssembly.Auth.Tests/Templates.Blazor.WebAssembly.Auth.Tests.csproj

+3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@
77
<TestGroupName>ProjectTemplates.Blazor.WebAssembly.Auth.Tests</TestGroupName>
88
<DefineConstants>$(DefineConstants);XPLAT</DefineConstants>
99

10+
<RequiresDelayedBuild>true</RequiresDelayedBuild>
11+
1012
<RunTemplateTests Condition="'$(RunTemplateTests)' == ''">true</RunTemplateTests>
1113
<SkipTests Condition="'$(RunTemplateTests)' != 'true'">true</SkipTests>
14+
<SkipTests Condition="'$(RunTemplateTests)' == 'true'">false</SkipTests>
1215
<BuildHelixPayload Condition="'$(RunTemplateTests)' != 'true'">false</BuildHelixPayload>
1316

1417
<BaseOutputPath />

src/ProjectTemplates/test/Templates.Blazor.WebAssembly.Tests/Templates.Blazor.WebAssembly.Tests.csproj

+3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@
77
<TestGroupName>ProjectTemplates.Blazor.WebAssembly.Tests</TestGroupName>
88
<DefineConstants>$(DefineConstants);XPLAT</DefineConstants>
99

10+
<RequiresDelayedBuild>true</RequiresDelayedBuild>
11+
1012
<RunTemplateTests Condition="'$(RunTemplateTests)' == ''">true</RunTemplateTests>
1113
<SkipTests Condition="'$(RunTemplateTests)' != 'true'">true</SkipTests>
14+
<SkipTests Condition="'$(RunTemplateTests)' == 'true'">false</SkipTests>
1215
<BuildHelixPayload Condition="'$(RunTemplateTests)' != 'true'">false</BuildHelixPayload>
1316

1417
<BaseOutputPath />

src/ProjectTemplates/test/Templates.Mvc.Tests/Templates.Mvc.Tests.csproj

+3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@
77
<TestGroupName>ProjectTemplates.Mvc.Tests</TestGroupName>
88
<DefineConstants>$(DefineConstants);XPLAT</DefineConstants>
99

10+
<RequiresDelayedBuild>true</RequiresDelayedBuild>
11+
1012
<RunTemplateTests Condition="'$(RunTemplateTests)' == ''">true</RunTemplateTests>
1113
<SkipTests Condition="'$(RunTemplateTests)' != 'true'">true</SkipTests>
14+
<SkipTests Condition="'$(RunTemplateTests)' == 'true'">false</SkipTests>
1215
<BuildHelixPayload Condition="'$(RunTemplateTests)' != 'true'">false</BuildHelixPayload>
1316

1417
<BaseOutputPath />

src/ProjectTemplates/test/Templates.Tests/Templates.Tests.csproj

+3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@
77
<TestGroupName>ProjectTemplates.Tests</TestGroupName>
88
<DefineConstants>$(DefineConstants);XPLAT</DefineConstants>
99

10+
<RequiresDelayedBuild>true</RequiresDelayedBuild>
11+
1012
<RunTemplateTests Condition="'$(RunTemplateTests)' == ''">true</RunTemplateTests>
1113
<SkipTests Condition="'$(RunTemplateTests)' != 'true'">true</SkipTests>
14+
<SkipTests Condition="'$(RunTemplateTests)' == 'true'">false</SkipTests>
1215
<BuildHelixPayload Condition="'$(RunTemplateTests)' != 'true'">false</BuildHelixPayload>
1316

1417
<BaseOutputPath />

0 commit comments

Comments
 (0)