Skip to content

Commit b5f6df0

Browse files
committed
Revert "Revert "Try using helix sdk support directly again (#23585)" (#24250)"
This reverts commit d9049ec.
1 parent e23f83d commit b5f6df0

File tree

6 files changed

+32
-56
lines changed

6 files changed

+32
-56
lines changed

eng/helix/content/InstallDotNet.ps1

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
<#
22
.SYNOPSIS
3-
Installs dotnet sdk and runtime using https://dot.net/v1/dotnet-install.ps1
3+
Installs dotnet runtime using https://dot.net/v1/dotnet-install.ps1
44
.DESCRIPTION
5-
Installs dotnet sdk and runtime using https://dot.net/v1/dotnet-install.ps1
5+
Installs dotnet runtime using https://dot.net/v1/dotnet-install.ps1
66
.PARAMETER arch
77
The architecture to install.
8-
.PARAMETER sdkVersion
9-
The sdk version to install
108
.PARAMETER runtimeVersion
119
The runtime version to install
1210
.PARAMETER installDir
@@ -16,9 +14,6 @@ param(
1614
[Parameter(Mandatory = $true)]
1715
$arch,
1816

19-
[Parameter(Mandatory = $true)]
20-
$sdkVersion,
21-
2217
[Parameter(Mandatory = $true)]
2318
$runtimeVersion,
2419

@@ -28,8 +23,6 @@ param(
2823

2924
& $PSScriptRoot\Download.ps1 "https://dot.net/v1/dotnet-install.ps1" $PSScriptRoot\dotnet-install.ps1
3025
Write-Host "Download of dotnet-install.ps1 complete..."
31-
Write-Host "Installing SDK...& $PSScriptRoot\dotnet-install.ps1 -Architecture $arch -Version $sdkVersion -InstallDir $installDir"
32-
Invoke-Expression "& $PSScriptRoot\dotnet-install.ps1 -Architecture $arch -Version $sdkVersion -InstallDir $installDir"
3326
Write-Host "Installing Runtime...& $PSScriptRoot\dotnet-install.ps1 -Architecture $arch -Runtime dotnet -Version $runtimeVersion -InstallDir $installDir"
3427
Invoke-Expression "& $PSScriptRoot\dotnet-install.ps1 -Architecture $arch -Runtime dotnet -Version $runtimeVersion -InstallDir $installDir"
35-
Write-Host "InstallDotNet.ps1 complete..."
28+
Write-Host "InstallDotNet.ps1 complete..."

eng/helix/content/RunTests/RunTestsOptions.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ 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" },
3126
description: "The version of the runtime being used")
@@ -70,7 +65,6 @@ public static RunTestsOptions Parse(string[] args)
7065
var parseResult = command.Parse(args);
7166
var options = new RunTestsOptions();
7267
options.Target = parseResult.ValueForOption<string>("--target");
73-
options.SdkVersion = parseResult.ValueForOption<string>("--sdk");
7468
options.RuntimeVersion = parseResult.ValueForOption<string>("--runtime");
7569
options.HelixQueue = parseResult.ValueForOption<string>("--queue");
7670
options.Architecture = parseResult.ValueForOption<string>("--arch");
@@ -86,7 +80,6 @@ public static RunTestsOptions Parse(string[] args)
8680
}
8781

8882
public string Target { get; set;}
89-
public string SdkVersion { get; set;}
9083
public string RuntimeVersion { get; set;}
9184
public string AspNetRuntime { get; set;}
9285
public string AspNetRef { get; set;}

eng/helix/content/runtests.cmd

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,36 @@ setlocal enabledelayedexpansion
44

55
REM Use '$' as a variable name prefix to avoid MSBuild variable collisions with these variables
66
set $target=%1
7-
set $sdkVersion=%2
8-
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
15-
REM Batch only supports up to 9 arguments using the %# syntax, need to shift to get more
16-
shift
7+
set $runtimeVersion=%2
8+
set $queue=%3
9+
set $arch=%4
10+
set $quarantined=%5
11+
set $ef=%6
12+
set $aspnetruntime=%7
13+
set $aspnetref=%8
1714
set $helixTimeout=%9
15+
REM Batch only supports up to 9 arguments using the %# syntax, need to shift to get more
1816

19-
set DOTNET_HOME=%HELIX_CORRELATION_PAYLOAD%\sdk
20-
set DOTNET_ROOT=%DOTNET_HOME%\%$arch%
17+
set DOTNET_ROOT=%HELIX_CORRELATION_PAYLOAD%\dotnet
18+
set DOTNET_HOME=%DOTNET_ROOT%
2119
set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
2220
set DOTNET_MULTILEVEL_LOOKUP=0
2321
set DOTNET_CLI_HOME=%HELIX_CORRELATION_PAYLOAD%\home
2422

2523
set PATH=%DOTNET_ROOT%;!PATH!;%HELIX_CORRELATION_PAYLOAD%\node\bin
2624
echo Set path to: %PATH%
27-
echo "Invoking InstallDotNet.ps1 %$arch% %$sdkVersion% %$runtimeVersion% %DOTNET_ROOT%"
28-
powershell.exe -NoProfile -ExecutionPolicy unrestricted -file InstallDotNet.ps1 %$arch% %$sdkVersion% %$runtimeVersion% %DOTNET_ROOT%
25+
echo "Invoking InstallDotNet.ps1 %$arch% %$runtimeVersion% %DOTNET_ROOT%"
26+
powershell.exe -NoProfile -ExecutionPolicy unrestricted -file InstallDotNet.ps1 %$arch% %$runtimeVersion% %DOTNET_ROOT%
27+
28+
dotnet --list-sdks
29+
dotnet --list-runtimes
2930

3031
set exit_code=0
3132
echo "Restore: dotnet restore RunTests\RunTests.csproj --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json --source https://api.nuget.org/v3/index.json --ignore-failed-sources..."
3233
dotnet restore RunTests\RunTests.csproj --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json --source https://api.nuget.org/v3/index.json --ignore-failed-sources
3334

34-
echo "Running tests: dotnet run --project RunTests\RunTests.csproj -- --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 -- --target %$target% --sdk %$sdkVersion% --runtime %$runtimeVersion% --queue %$queue% --arch %$arch% --quarantined %$quarantined% --ef %$ef% --aspnetruntime %$aspnetruntime% --aspnetref %$aspnetref% --helixTimeout %$helixTimeout%
35+
echo "Running tests: dotnet run --project RunTests\RunTests.csproj -- --target %$target% --runtime %$runtimeVersion% --queue %$queue% --arch %$arch% --quarantined %$quarantined% --ef %$ef% --aspnetruntime %$aspnetruntime% --aspnetref %$aspnetref% --helixTimeout %$helixTimeout%..."
36+
dotnet run --project RunTests\RunTests.csproj -- --target %$target% --runtime %$runtimeVersion% --queue %$queue% --arch %$arch% --quarantined %$quarantined% --ef %$ef% --aspnetruntime %$aspnetruntime% --aspnetref %$aspnetref% --helixTimeout %$helixTimeout%
3637
if errorlevel neq 0 (
3738
set exit_code=%errorlevel%
3839
)

eng/helix/content/runtests.sh

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env bash
22

3-
dotnet_sdk_version="$2"
4-
dotnet_runtime_version="$3"
3+
dotnet_runtime_version="$2"
54

65
RESET="\033[0m"
76
RED="\033[0;31m"
@@ -11,7 +10,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
1110

1211
# Ensures every invocation of dotnet apps uses the same dotnet.exe
1312
# Add $random to path to ensure tests don't expect dotnet to be in a particular path
14-
export DOTNET_ROOT="$DIR/.dotnet$RANDOM"
13+
export DOTNET_ROOT="$HELIX_CORRELATION_PAYLOAD/dotnet"
1514

1615
# Ensure dotnet comes first on PATH
1716
export PATH="$DOTNET_ROOT:$PATH:$DIR/node/bin"
@@ -47,20 +46,6 @@ fi
4746
# Call "sync" between "chmod" and execution to prevent "text file busy" error in Docker (aufs)
4847
chmod +x "dotnet-install.sh"; sync
4948

50-
./dotnet-install.sh --version $dotnet_sdk_version --install-dir "$DOTNET_ROOT"
51-
if [ $? -ne 0 ]; then
52-
sdk_retries=3
53-
while [ $sdk_retries -gt 0 ]; do
54-
./dotnet-install.sh --version $dotnet_sdk_version --install-dir "$DOTNET_ROOT"
55-
if [ $? -ne 0 ]; then
56-
let sdk_retries=sdk_retries-1
57-
echo -e "${YELLOW}Failed to install .NET Core SDK $version. Retries left: $sdk_retries.${RESET}"
58-
else
59-
sdk_retries=0
60-
fi
61-
done
62-
fi
63-
6449
./dotnet-install.sh --runtime dotnet --version $dotnet_runtime_version --install-dir "$DOTNET_ROOT"
6550
if [ $? -ne 0 ]; then
6651
runtime_retries=3
@@ -85,11 +70,14 @@ fi
8570
# dontet-install.sh seems to affect the Linux filesystem and causes test flakiness unless we sync the filesystem before running tests
8671
sync
8772

73+
$DOTNET_ROOT/dotnet --list-sdks
74+
$DOTNET_ROOT/dotnet --list-runtimes
75+
8876
exit_code=0
8977
echo "Restore: $DOTNET_ROOT/dotnet restore RunTests/RunTests.csproj --source https://api.nuget.org/v3/index.json --ignore-failed-sources..."
9078
$DOTNET_ROOT/dotnet restore RunTests/RunTests.csproj --source https://api.nuget.org/v3/index.json --ignore-failed-sources
91-
echo "Running tests: $DOTNET_ROOT/dotnet run --project RunTests/RunTests.csproj -- --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 -- --target $1 --sdk $2 --runtime $3 --queue $4 --arch $5 --quarantined $6 --ef $7 --aspnetruntime $8 --aspnetref $9 --helixTimeout ${10}
79+
echo "Running tests: $DOTNET_ROOT/dotnet run --project RunTests/RunTests.csproj -- --target $1 --runtime $2 --queue $3 --arch $4 --quarantined $5 --ef $6 --aspnetruntime $7 --aspnetref $8 --helixTimeout $9..."
80+
$DOTNET_ROOT/dotnet run --project RunTests/RunTests.csproj -- --target $1 --runtime $2 --queue $3 --arch $4 --quarantined $5 --ef $6 --aspnetruntime $7 --aspnetref $8 --helixTimeout $9
9381
exit_code=$?
9482
echo "Finished tests...exit_code=$exit_code"
9583

eng/helix/helix.proj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<Project Sdk="Microsoft.DotNet.Helix.Sdk" DefaultTargets="Test" TreatAsLocalProperty="ProjectToBuild">
2-
32
<PropertyGroup>
43
<!--
54
When invoking helix.proj for the whole repo with build.cmd, ProjectToBuild will be set to the path to this project.
@@ -22,7 +21,9 @@
2221
<IsExternal>true</IsExternal>
2322
<MaxRetryCount Condition="'$(MaxRetryCount)' == ''">2</MaxRetryCount>
2423
<HelixAccessToken Condition="'$(_UseHelixOpenQueues)' != 'true'">$(HelixApiAccessToken)</HelixAccessToken>
25-
24+
<IncludeDotNetCli>true</IncludeDotNetCli>
25+
<DotNetCliPackageType>sdk</DotNetCliPackageType>
26+
2627
<!-- Copied from Microsoft.NET.DefaultOutputPaths.targets in the .NET SDK. The Helix SDK contains nothing similar. -->
2728
<BaseOutputPath Condition="'$(BaseOutputPath)' == ''">bin\</BaseOutputPath>
2829
<OutputPath Condition="'$(OutputPath)' == '' and '$(PlatformName)' == 'AnyCPU'">$(BaseOutputPath)$(Configuration)\</OutputPath>

eng/targets/Helix.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ Usage: dotnet msbuild /t:Helix src/MyTestProject.csproj
117117
<TestAssembly>$(TargetFileName)</TestAssembly>
118118
<PreCommands>@(HelixPreCommand)</PreCommands>
119119
<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>
120+
<Command Condition="$(IsWindowsHelixQueue)">call runtests.cmd $(TargetFileName) $(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) $(MicrosoftNETCoreAppRuntimeVersion) $(_HelixFriendlyNameTargetQueue) $(TargetArchitecture) $(RunQuarantinedTests) $(DotnetEfPackageVersion) Microsoft.AspNetCore.App.Runtime.win-x64.$(AppRuntimeVersion).nupkg Microsoft.AspNetCore.App.Ref.$(AppRuntimeVersion).nupkg $(HelixTimeout)</Command>
122122
<Command Condition="$(HelixCommand) != ''">$(HelixCommand)</Command>
123123
<Timeout>$(HelixTimeout)</Timeout>
124124
</HelixWorkItem>

0 commit comments

Comments
 (0)