Skip to content

Commit 0551cef

Browse files
authored
Cleanup Helix infrastructure slightly (#32554)
* Remove unused `$(HelixUseArchive)` property * Move helix.proj output into artifacts/bin/helix/ - remove `$(Configuration)` and `$(PlatformName)` from output path - other layouts aren't that specific - properties weren't available anyhow in some cases nits: - provide the .version file expected in .dotnet/shared/… - rename `AspNetCoreAppRuntimeHelix/` -> `SharedFx.Layout/`; same for the correlation payload archive - rename `AspNetCoreAppRuntimeHelixRaw/` -> `SharedFx.Unzip/` * Support added `msbuild` arguments in RunHelix.ps1 nit: use `[switch]` instead of `[bool]`
1 parent 63ece74 commit 0551cef

File tree

4 files changed

+46
-36
lines changed

4 files changed

+46
-36
lines changed

eng/helix/helix.proj

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<Import Project="..\targets\Helix.Common.props" />
1212
<Import Project="..\Build.props" />
1313
<Import Project="..\Versions.props" />
14-
14+
1515
<!-- Microsoft.DotNet.Helix.Sdk.MultiQueue.targets splits $(HelixTargetQueues) into @(HelixTargetQueue) items. -->
1616
<ItemGroup Condition=" '$(HelixTargetQueues)' == '' ">
1717
<HelixTargetQueue Condition="'$(_UseHelixOpenQueues)' == 'true'" Include="@(HelixAvailableTargetQueue)" />
@@ -26,13 +26,11 @@
2626
<HelixAccessToken Condition="'$(_UseHelixOpenQueues)' != 'true'">$(HelixApiAccessToken)</HelixAccessToken>
2727
<IncludeDotNetCli>true</IncludeDotNetCli>
2828
<DotNetCliPackageType>sdk</DotNetCliPackageType>
29-
<DotNetCliVersion>$(NETCoreSdkVersion)</DotNetCliVersion>
29+
<DotNetCliVersion>$(NETCoreSdkVersion)</DotNetCliVersion>
3030
<DotNetCliChannel>Current</DotNetCliChannel>
3131

32-
<!-- Copied from Microsoft.NET.DefaultOutputPaths.targets in the .NET SDK. The Helix SDK contains nothing similar. -->
33-
<BaseOutputPath Condition="'$(BaseOutputPath)' == ''">bin\</BaseOutputPath>
34-
<OutputPath Condition="'$(OutputPath)' == '' and '$(PlatformName)' == 'AnyCPU'">$(BaseOutputPath)$(Configuration)\</OutputPath>
35-
<OutputPath Condition="'$(OutputPath)' == '' and '$(PlatformName)' != 'AnyCPU'">$(BaseOutputPath)$(PlatformName)\$(Configuration)\</OutputPath>
32+
<!-- Similar to ProjectLayout.props in the Arcade SDK. The Helix SDK contains nothing similar. -->
33+
<OutputPath Condition=" '$(OutputPath)' == '' ">$(RepoRoot)artifacts\bin\$(MSBuildProjectName)\</OutputPath>
3634
</PropertyGroup>
3735

3836
<!-- Specify the runtime we need which will be included as a correlation payload -->
@@ -44,7 +42,7 @@
4442
<PackageType>runtime</PackageType>
4543
</AdditionalDotNetPackage>
4644
</ItemGroup>
47-
45+
4846
<PropertyGroup Condition=" '$(ContinuousIntegrationBuild)' == 'true' ">
4947
<HelixType>ci</HelixType>
5048
<!-- Creator is not valid for internal queues -->
@@ -86,30 +84,35 @@
8684

8785
<PropertyGroup>
8886
<SharedFxVersion>@(_ResolvedProductVersionInfo->'%(PackageVersion)')</SharedFxVersion>
89-
</PropertyGroup>
90-
87+
</PropertyGroup>
88+
89+
<!-- Use package because .dotnet/ folder doesn't contain RuntimeList.xml file and SharedFxTests checks that. -->
9190
<Unzip Condition="Exists('$(RepoRoot)artifacts\packages\$(Configuration)\Shipping\Microsoft.AspNetCore.App.Runtime.$(TargetRuntimeIdentifier).$(SharedFxVersion).nupkg')"
92-
SourceFiles="$(RepoRoot)artifacts\packages\$(Configuration)\Shipping\Microsoft.AspNetCore.App.Runtime.$(TargetRuntimeIdentifier).$(SharedFxVersion).nupkg"
93-
DestinationFolder="$(OutputPath)\AspNetCoreAppRuntimeHelixRaw" />
91+
SourceFiles="$(RepoRoot)artifacts\packages\$(Configuration)\Shipping\Microsoft.AspNetCore.App.Runtime.$(TargetRuntimeIdentifier).$(SharedFxVersion).nupkg"
92+
DestinationFolder="$(OutputPath)\SharedFx.Unzip" />
9493
<ItemGroup>
95-
<_appRuntimeFiles Include="$(OutputPath)\AspNetCoreAppRuntimeHelixRaw\**\*.txt" />
96-
<_appRuntimeFiles Include="$(OutputPath)\AspNetCoreAppRuntimeHelixRaw\**\*.json" />
97-
<_appRuntimeFiles Include="$(OutputPath)\AspNetCoreAppRuntimeHelixRaw\**\*.dll" />
98-
<_appRuntimeFiles Include="$(OutputPath)\AspNetCoreAppRuntimeHelixRaw\**\*.xml" />
94+
<_appRuntimeFiles Include="$(OutputPath)\SharedFx.Unzip\**\*.txt" />
95+
<_appRuntimeFiles Include="$(OutputPath)\SharedFx.Unzip\**\*.json" />
96+
<_appRuntimeFiles Include="$(OutputPath)\SharedFx.Unzip\**\*.dll" />
97+
<_appRuntimeFiles Include="$(OutputPath)\SharedFx.Unzip\**\RuntimeList.xml" />
9998
</ItemGroup>
100-
<Copy SourceFiles="@(_appRuntimeFiles)" DestinationFolder="$(OutputPath)\AspNetCoreAppRuntimeHelix\shared\Microsoft.AspNetCore.App\$(SharedFxVersion)" />
101-
<Unzip Condition="Exists('$(RepoRoot)artifacts\packages\$(Configuration)\Shipping\Microsoft.AspNetCore.App.Ref.$(SharedFxVersion).nupkg')"
102-
SourceFiles="$(RepoRoot)artifacts\packages\$(Configuration)\Shipping\Microsoft.AspNetCore.App.Ref.$(SharedFxVersion).nupkg"
103-
DestinationFolder="$(OutputPath)\AspNetCoreAppRuntimeHelix\packs\Microsoft.AspNetCore.App.Ref\$(SharedFxVersion)" />
104-
<ZipDirectory Condition="Exists('$(OutputPath)\AspNetCoreAppRuntimeHelix')"
105-
SourceDirectory="$(OutputPath)\AspNetCoreAppRuntimeHelix"
106-
DestinationFile="$(OutputPath)\AspNetCoreAppRuntimeHelix.zip" Overwrite="true" />
107-
99+
<Copy SourceFiles="@(_appRuntimeFiles)"
100+
DestinationFolder="$(OutputPath)\SharedFx.Layout\shared\Microsoft.AspNetCore.App\$(SharedFxVersion)" />
101+
<Copy SourceFiles="$(OutputPath)\SharedFx.Unzip\Microsoft.AspNetCore.App.versions.txt"
102+
DestinationFiles="$(OutputPath)\SharedFx.Layout\shared\Microsoft.AspNetCore.App\$(SharedFxVersion)\.version" />
103+
104+
<Unzip Condition="Exists('$(RepoRoot)artifacts\packages\$(Configuration)\Shipping\Microsoft.AspNetCore.App.Ref.$(SharedFxVersion).nupkg')"
105+
SourceFiles="$(RepoRoot)artifacts\packages\$(Configuration)\Shipping\Microsoft.AspNetCore.App.Ref.$(SharedFxVersion).nupkg"
106+
DestinationFolder="$(OutputPath)\SharedFx.Layout\packs\Microsoft.AspNetCore.App.Ref\$(SharedFxVersion)" />
107+
<ZipDirectory Condition="Exists('$(OutputPath)\SharedFx.Layout')"
108+
SourceDirectory="$(OutputPath)\SharedFx.Layout"
109+
DestinationFile="$(OutputPath)\SharedFx.Layout.zip" Overwrite="true" />
110+
108111
<ItemGroup>
109-
<HelixCorrelationPayload Include="$(OutputPath)\AspNetCoreAppRuntimeHelix.zip" Destination="$(DotNetCliDestination)" />
112+
<HelixCorrelationPayload Include="$(OutputPath)\SharedFx.Layout.zip" Destination="$(DotNetCliDestination)" />
110113
</ItemGroup>
111114
</Target>
112-
115+
113116
<Target Name="Gather" BeforeTargets="Build">
114117
<MSBuild Projects="@(ProjectToBuild)"
115118
Targets="CreateHelixPayload"

eng/scripts/RunHelix.ps1

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,27 @@
1919
Redhat.7.Amd64.Open
2020
.PARAMETER RunQuarantinedTests
2121
By default quarantined tests are not run. Set this to $true to run only the quarantined tests.
22+
.PARAMETER TargetArchitecture
23+
The CPU architecture to build for (x64, x86, arm). Default=x64
24+
.PARAMETER MSBuildArguments
25+
Additional MSBuild arguments to be passed through.
2226
#>
27+
[CmdletBinding(PositionalBinding = $false)]
2328
param(
2429
[Parameter(Mandatory=$true)]
2530
[string]$Project,
31+
2632
[string]$HelixQueues = "Windows.10.Amd64.Open",
33+
[switch]$RunQuarantinedTests,
34+
35+
[ValidateSet('x64', 'x86', 'arm', 'arm64')]
2736
[string]$TargetArchitecture = "x64",
28-
[bool]$RunQuarantinedTests = $false
37+
38+
# Capture the rest
39+
[Parameter(ValueFromRemainingArguments = $true)]
40+
[string[]]$MSBuildArguments
2941
)
42+
3043
$ErrorActionPreference = 'Stop'
3144
$ProgressPreference = 'SilentlyContinue' # Workaround PowerShell/PowerShell#2138
3245

@@ -43,4 +56,5 @@ Write-Host -ForegroundColor Yellow "And if packing for a different platform, add
4356
$HelixQueues = $HelixQueues -replace ";", "%3B"
4457
dotnet msbuild $Project /t:Helix /p:TargetArchitecture="$TargetArchitecture" /p:IsRequiredCheck=true `
4558
/p:IsHelixDaily=true /p:HelixTargetQueues=$HelixQueues /p:RunQuarantinedTests=$RunQuarantinedTests `
46-
/p:_UseHelixOpenQueues=true /p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
59+
/p:_UseHelixOpenQueues=true /p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log `
60+
@MSBuildArguments

eng/targets/Helix.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
<IsMacHelixQueue>false</IsMacHelixQueue>
2020
<IsMacHelixQueue Condition="$(HelixTargetQueue.Contains('OSX')) or $(HelixTargetQueue.Contains('macOs'))">true</IsMacHelixQueue>
2121
<HelixTestName>$(MSBuildProjectName)--$(TargetFramework)</HelixTestName>
22-
<HelixUseArchive>false</HelixUseArchive>
2322
<LoggingTestingDisableFileLogging Condition="'$(IsHelixJob)' == 'true'">false</LoggingTestingDisableFileLogging>
2423
<NodeVersion>10.15.3</NodeVersion>
2524
<TestDependsOnAspNetPackages>false</TestDependsOnAspNetPackages>

eng/targets/Helix.targets

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,6 @@
122122
</PropertyGroup>
123123
</Target>
124124

125-
<Target Name="_PublishHelixArchive" DependsOnTargets="Publish" >
126-
<ZipDirectory Condition="'$(HelixUseArchive)' == 'true'" SourceDirectory="$(PublishDir)" DestinationFile="$(PublishDir)../$(HelixTestName).zip" Overwrite="true" />
127-
<RemoveDir Condition="'$(HelixUseArchive)' == 'true'" Directories="$(PublishDir)" />
128-
</Target>
129-
130125
<Target Name="_CreateHelixWorkItem" Condition="$(BuildHelixPayload)">
131126
<PropertyGroup>
132127
<!-- Extract the effective queue name from this format "(name)host@dockerimage". This is sometimes used in test code to skip tests. -->
@@ -135,7 +130,7 @@
135130
</PropertyGroup>
136131

137132
<!-- Important: If HelixTargetQueue is not removed here, then Publish will occur for every single queue type. And since Publish shouldn't depend on the queue we can just publish once -->
138-
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="_PublishHelixArchive" RemoveProperties="HelixTargetQueue;TestRunId" />
133+
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="Publish" RemoveProperties="HelixTargetQueue;TestRunId" />
139134

140135
<!-- Isolate Helix tests from whatever happens to be in a parent directory. -->
141136
<Copy SourceFiles="$(RepoRoot)eng\helix\content\Directory.Build.empty.in"
@@ -178,8 +173,7 @@
178173
</ConvertToAbsolutePath>
179174
<ItemGroup>
180175
<HelixWorkItem Include="$(HelixTestName)">
181-
<PayloadArchive Condition="'$(HelixUseArchive)' == 'true'">$(PublishAbsoluteDir)../$(HelixTestName).zip</PayloadArchive>
182-
<PayloadDirectory Condition="'$(HelixUseArchive)' == 'false'">$(PublishAbsoluteDir)</PayloadDirectory>
176+
<PayloadDirectory>$(PublishAbsoluteDir)</PayloadDirectory>
183177
<TestAssembly>$(TargetFileName)</TestAssembly>
184178
<PreCommands>@(HelixPreCommand)</PreCommands>
185179
<PostCommands>@(HelixPostCommand)</PostCommands>

0 commit comments

Comments
 (0)