Skip to content

Commit e68d14f

Browse files
committed
Do not use $(AppRuntimeVersion) or NETCore version for shared Fx in Helix runs
- remove hard-coded `$(AppRuntimeVersion)` property entirely - use `$(SharedFxVersion)` instead - install Microsoft.AspNetCore.App.Runtime packages in `$(SharedFxVersion)` folder nits: - make `RunTests` help more clear about how `--runtime` option is used - remove unused `--sdk` option on `RunTests` command line - add Microsoft.AspNetCore.App.Ref package to Helix content later, ensuring it exists
1 parent b821ff7 commit e68d14f

File tree

5 files changed

+29
-26
lines changed

5 files changed

+29
-26
lines changed

eng/helix/content/RunTests/RunTestsOptions.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,9 @@ public static RunTestsOptions Parse(string[] args)
2121
description: "The test dll to run")
2222
{ Argument = new Argument<string>(), Required = true },
2323

24-
new Option(
25-
aliases: new string[] { "--sdk" },
26-
description: "The version of the sdk being used")
27-
{ Argument = new Argument<string>(), Required = true },
28-
2924
new Option(
3025
aliases: new string[] { "--runtime" },
31-
description: "The version of the runtime being used")
26+
description: "The version of the ASP.NET runtime being installed and used")
3227
{ Argument = new Argument<string>(), Required = true },
3328

3429
new Option(
@@ -75,7 +70,6 @@ public static RunTestsOptions Parse(string[] args)
7570
var parseResult = command.Parse(args);
7671
var options = new RunTestsOptions();
7772
options.Target = parseResult.ValueForOption<string>("--target");
78-
options.SdkVersion = parseResult.ValueForOption<string>("--sdk");
7973
options.RuntimeVersion = parseResult.ValueForOption<string>("--runtime");
8074
options.HelixQueue = parseResult.ValueForOption<string>("--queue");
8175
options.Architecture = parseResult.ValueForOption<string>("--arch");

eng/helix/content/runtests.cmd

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@ REM Use '$' as a variable name prefix to avoid MSBuild variable collisions with
66
set $target=%1
77
set $sdkVersion=%2
88
set $runtimeVersion=%3
9-
set $queue=%4
10-
set $arch=%5
11-
set $quarantined=%6
12-
set $ef=%7
13-
set $aspnetruntime=%8
14-
set $aspnetref=%9
9+
set $aspRuntimeVersion=%4
10+
set $queue=%5
11+
set $arch=%6
12+
set $quarantined=%7
13+
set $ef=%8
14+
set $aspnetruntime=%9
1515
REM Batch only supports up to 9 arguments using the %# syntax, need to shift to get more
1616
shift
17+
set $aspnetref=%9
18+
shift
1719
set $helixTimeout=%9
1820

1921
set DOTNET_HOME=%HELIX_CORRELATION_PAYLOAD%\sdk
@@ -31,8 +33,8 @@ set exit_code=0
3133
echo "Restore: dotnet restore RunTests\RunTests.csproj --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json --source https://api.nuget.org/v3/index.json --ignore-failed-sources..."
3234
dotnet restore RunTests\RunTests.csproj --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json --source https://api.nuget.org/v3/index.json --ignore-failed-sources
3335

34-
echo "Running tests: dotnet run --project RunTests\RunTests.csproj -- --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json --target %$target% --sdk %$sdkVersion% --runtime %$runtimeVersion% --queue %$queue% --arch %$arch% --quarantined %$quarantined% --ef %$ef% --aspnetruntime %$aspnetruntime% --aspnetref %$aspnetref% --helixTimeout %$helixTimeout%..."
35-
dotnet run --project RunTests\RunTests.csproj -- --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json --target %$target% --sdk %$sdkVersion% --runtime %$runtimeVersion% --queue %$queue% --arch %$arch% --quarantined %$quarantined% --ef %$ef% --aspnetruntime %$aspnetruntime% --aspnetref %$aspnetref% --helixTimeout %$helixTimeout%
36+
echo "Running tests: dotnet run --project RunTests\RunTests.csproj -- --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json --target %$target% --runtime %$aspRuntimeVersion% --queue %$queue% --arch %$arch% --quarantined %$quarantined% --ef %$ef% --aspnetruntime %$aspnetruntime% --aspnetref %$aspnetref% --helixTimeout %$helixTimeout%..."
37+
dotnet run --project RunTests\RunTests.csproj -- --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json --target %$target% --runtime %$aspRuntimeVersion% --queue %$queue% --arch %$arch% --quarantined %$quarantined% --ef %$ef% --aspnetruntime %$aspnetruntime% --aspnetref %$aspnetref% --helixTimeout %$helixTimeout%
3638
if errorlevel neq 0 (
3739
set exit_code=%errorlevel%
3840
)

eng/helix/content/runtests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ sync
8888
exit_code=0
8989
echo "Restore: $DOTNET_ROOT/dotnet restore RunTests/RunTests.csproj --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json --source https://api.nuget.org/v3/index.json --ignore-failed-sources..."
9090
$DOTNET_ROOT/dotnet restore RunTests/RunTests.csproj --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json --source https://api.nuget.org/v3/index.json --ignore-failed-sources
91-
echo "Running tests: $DOTNET_ROOT/dotnet run --project RunTests/RunTests.csproj -- --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json --target $1 --sdk $2 --runtime $3 --queue $4 --arch $5 --quarantined $6 --ef $7 --aspnetruntime $8 --aspnetref $9 --helixTimeout ${10}..."
92-
$DOTNET_ROOT/dotnet run --project RunTests/RunTests.csproj -- --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json --target $1 --sdk $2 --runtime $3 --queue $4 --arch $5 --quarantined $6 --ef $7 --aspnetruntime $8 --aspnetref $9 --helixTimeout ${10}
91+
echo "Running tests: $DOTNET_ROOT/dotnet run --project RunTests/RunTests.csproj -- --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json --target $1 --runtime $4 --queue $5 --arch $6 --quarantined $7 --ef $8 --aspnetruntime $9 --aspnetref ${10} --helixTimeout ${11}"
92+
$DOTNET_ROOT/dotnet run --project RunTests/RunTests.csproj -- --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json --target $1 --runtime $4 --queue $5 --arch $6 --quarantined $7 --ef $8 --aspnetruntime $9 --aspnetref ${10} --helixTimeout ${11}
9393
exit_code=$?
9494
echo "Finished tests...exit_code=$exit_code"
9595

eng/targets/Helix.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
<HelixUseArchive>false</HelixUseArchive>
2323
<LoggingTestingDisableFileLogging Condition="'$(IsHelixJob)' == 'true'">false</LoggingTestingDisableFileLogging>
2424
<NodeVersion>10.15.3</NodeVersion>
25-
<AppRuntimeVersion>5.0.0-ci</AppRuntimeVersion>
2625
<TestDependsOnAspNetRuntime>false</TestDependsOnAspNetRuntime>
2726
</PropertyGroup>
2827

eng/targets/Helix.targets

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616
<HelixPreCommand Include="call RunPowershell.cmd InstallNode.ps1 $(NodeVersion) %25HELIX_CORRELATION_PAYLOAD%25\node\bin || exit /b 1" />
1717
</ItemGroup>
1818

19-
<ItemGroup Condition="'$(IsHelixJob)' == 'true' AND '$(TestDependsOnAspNetRef)' == 'true' AND '$(IsTargetingPackBuilding)' == 'true'">
20-
<HelixContent Include="$(RepoRoot)artifacts\packages\Release\Shipping\Microsoft.AspNetCore.App.Ref.$(AppRuntimeVersion).nupkg" />
21-
</ItemGroup>
22-
2319
<ItemGroup Condition="'$(IsHelixJob)' == 'true' AND '$(TestDependsOnAspNetRuntime)' == 'true'">
2420
<HelixContent Include="$(RepoRoot)artifacts\packages\Release\Shipping\*-ci.nupkg" />
2521
</ItemGroup>
@@ -91,11 +87,23 @@ Usage: dotnet msbuild /t:Helix src/MyTestProject.csproj
9187
</Target>
9288

9389
<Target Name="_CreateHelixWorkItem" Condition="$(BuildHelixPayload)">
94-
9590
<ItemGroup>
9691
<HelixContent Include="$(OutputPath)/Microsoft.VisualStudio.TestPlatform.Extension.Xunit.Xml.TestAdapter.dll" />
9792
<HelixContent Include="$(OutputPath)/Microsoft.VisualStudio.TestPlatform.Extension.Xunit.Xml.TestLogger.dll" />
98-
<HelixContent Condition="'$(TestDependsOnAspNetRuntime)' == 'true'" Include="$(RepoRoot)artifacts\packages\Release\Shipping\Microsoft.AspNetCore.App.Runtime.win-x64.$(AppRuntimeVersion).nupkg" />
93+
</ItemGroup>
94+
95+
<!--
96+
Could use _GetPackageVersionInfo target (defined in eng/targets/Packaging.targets and included in every C#
97+
and F# project) instead of the $(SharedFxVersion) property but the property works everywhere except in site
98+
extensions projects. Could also use $(TargetingPackVersion) but that has slightly more complicated semantics
99+
and doesn't keep up when in servicing.
100+
-->
101+
<ItemGroup Condition=" '$(TestDependsOnAspNetRef)' == 'true' AND '$(IsTargetingPackBuilding)' == 'true' ">
102+
<HelixContent Include="$(RepoRoot)artifacts\packages\Release\Shipping\Microsoft.AspNetCore.App.Ref.$(SharedFxVersion).nupkg" />
103+
</ItemGroup>
104+
105+
<ItemGroup Condition=" '$(TestDependsOnAspNetRuntime)' == 'true' ">
106+
<HelixContent Include="$(RepoRoot)artifacts\packages\Release\Shipping\Microsoft.AspNetCore.App.Runtime.win-x64.$(SharedFxVersion).nupkg" />
99107
</ItemGroup>
100108

101109
<PropertyGroup>
@@ -117,8 +125,8 @@ Usage: dotnet msbuild /t:Helix src/MyTestProject.csproj
117125
<TestAssembly>$(TargetFileName)</TestAssembly>
118126
<PreCommands>@(HelixPreCommand)</PreCommands>
119127
<PostCommands>@(HelixPostCommand)</PostCommands>
120-
<Command Condition="$(IsWindowsHelixQueue)">call runtests.cmd $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppRuntimeVersion) $(_HelixFriendlyNameTargetQueue) $(TargetArchitecture) $(RunQuarantinedTests) $(DotnetEfPackageVersion) Microsoft.AspNetCore.App.Runtime.win-x64.$(AppRuntimeVersion).nupkg Microsoft.AspNetCore.App.Ref.$(AppRuntimeVersion).nupkg $(HelixTimeout)</Command>
121-
<Command Condition="!$(IsWindowsHelixQueue)">./runtests.sh $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppRuntimeVersion) $(_HelixFriendlyNameTargetQueue) $(TargetArchitecture) $(RunQuarantinedTests) $(DotnetEfPackageVersion) Microsoft.AspNetCore.App.Runtime.win-x64.$(AppRuntimeVersion).nupkg Microsoft.AspNetCore.App.Ref.$(AppRuntimeVersion).nupkg $(HelixTimeout)</Command>
128+
<Command Condition="$(IsWindowsHelixQueue)">call runtests.cmd $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppRuntimeVersion) $(SharedFxVersion) $(_HelixFriendlyNameTargetQueue) $(TargetArchitecture) $(RunQuarantinedTests) $(DotnetEfPackageVersion) Microsoft.AspNetCore.App.Runtime.win-x64.$(SharedFxVersion).nupkg Microsoft.AspNetCore.App.Ref.$(SharedFxVersion).nupkg $(HelixTimeout)</Command>
129+
<Command Condition="!$(IsWindowsHelixQueue)">./runtests.sh $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppRuntimeVersion) $(SharedFxVersion) $(_HelixFriendlyNameTargetQueue) $(TargetArchitecture) $(RunQuarantinedTests) $(DotnetEfPackageVersion) Microsoft.AspNetCore.App.Runtime.win-x64.$(SharedFxVersion).nupkg Microsoft.AspNetCore.App.Ref.$(SharedFxVersion).nupkg $(HelixTimeout)</Command>
122130
<Command Condition="$(HelixCommand) != ''">$(HelixCommand)</Command>
123131
<Timeout>$(HelixTimeout)</Timeout>
124132
</HelixWorkItem>

0 commit comments

Comments
 (0)