From bb70f71e06eed1d2471ba51ec7a907dea747c8f7 Mon Sep 17 00:00:00 2001 From: Doug Bunting <6431421+dougbu@users.noreply.github.com> Date: Sat, 22 Aug 2020 12:21:31 -0700 Subject: [PATCH] Do not use `$(AppRuntimeVersion)` or NETCore version for shared Fx in Helix runs - remove hard-coded `$(AppRuntimeVersion)` property entirely - use `$(SharedFxVersion)` instead 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 --- eng/helix/content/RunTests/RunTestsOptions.cs | 8 +------ eng/helix/content/runtests.cmd | 18 +++++++------- eng/helix/content/runtests.sh | 4 ++-- eng/targets/Helix.props | 1 - eng/targets/Helix.targets | 24 ++++++++++++------- 5 files changed, 29 insertions(+), 26 deletions(-) diff --git a/eng/helix/content/RunTests/RunTestsOptions.cs b/eng/helix/content/RunTests/RunTestsOptions.cs index 9e076c970137..bd611ef46ee5 100644 --- a/eng/helix/content/RunTests/RunTestsOptions.cs +++ b/eng/helix/content/RunTests/RunTestsOptions.cs @@ -21,14 +21,9 @@ public static RunTestsOptions Parse(string[] args) description: "The test dll to run") { Argument = new Argument(), Required = true }, - new Option( - aliases: new string[] { "--sdk" }, - description: "The version of the sdk being used") - { Argument = new Argument(), Required = true }, - new Option( aliases: new string[] { "--runtime" }, - description: "The version of the runtime being used") + description: "The version of the ASP.NET runtime being installed and used") { Argument = new Argument(), Required = true }, new Option( @@ -70,7 +65,6 @@ public static RunTestsOptions Parse(string[] args) var parseResult = command.Parse(args); var options = new RunTestsOptions(); options.Target = parseResult.ValueForOption("--target"); - options.SdkVersion = parseResult.ValueForOption("--sdk"); options.RuntimeVersion = parseResult.ValueForOption("--runtime"); options.HelixQueue = parseResult.ValueForOption("--queue"); options.Architecture = parseResult.ValueForOption("--arch"); diff --git a/eng/helix/content/runtests.cmd b/eng/helix/content/runtests.cmd index c1b27b1c890c..af984dd88274 100644 --- a/eng/helix/content/runtests.cmd +++ b/eng/helix/content/runtests.cmd @@ -6,14 +6,16 @@ REM Use '$' as a variable name prefix to avoid MSBuild variable collisions with set $target=%1 set $sdkVersion=%2 set $runtimeVersion=%3 -set $queue=%4 -set $arch=%5 -set $quarantined=%6 -set $ef=%7 -set $aspnetruntime=%8 -set $aspnetref=%9 +set $aspRuntimeVersion=%4 +set $queue=%5 +set $arch=%6 +set $quarantined=%7 +set $ef=%8 +set $aspnetruntime=%9 REM Batch only supports up to 9 arguments using the %# syntax, need to shift to get more shift +set $aspnetref=%9 +shift set $helixTimeout=%9 set DOTNET_HOME=%HELIX_CORRELATION_PAYLOAD%\sdk @@ -31,8 +33,8 @@ set exit_code=0 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..." 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 -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%..." -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% +echo "Running tests: dotnet run --project RunTests\RunTests.csproj -- --target %$target% --runtime %$aspRuntimeVersion% --queue %$queue% --arch %$arch% --quarantined %$quarantined% --ef %$ef% --aspnetruntime %$aspnetruntime% --aspnetref %$aspnetref% --helixTimeout %$helixTimeout%..." +dotnet run --project RunTests\RunTests.csproj -- --target %$target% --runtime %$aspRuntimeVersion% --queue %$queue% --arch %$arch% --quarantined %$quarantined% --ef %$ef% --aspnetruntime %$aspnetruntime% --aspnetref %$aspnetref% --helixTimeout %$helixTimeout% if errorlevel neq 0 ( set exit_code=%errorlevel% ) diff --git a/eng/helix/content/runtests.sh b/eng/helix/content/runtests.sh index a1bf93270604..79f0edb53503 100644 --- a/eng/helix/content/runtests.sh +++ b/eng/helix/content/runtests.sh @@ -88,8 +88,8 @@ sync exit_code=0 echo "Restore: $DOTNET_ROOT/dotnet restore RunTests/RunTests.csproj --source https://api.nuget.org/v3/index.json --ignore-failed-sources..." $DOTNET_ROOT/dotnet restore RunTests/RunTests.csproj --source https://api.nuget.org/v3/index.json --ignore-failed-sources -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}..." -$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} +echo "Running tests: $DOTNET_ROOT/dotnet run --project RunTests/RunTests.csproj -- --target $1 --runtime $4 --queue $5 --arch $6 --quarantined $7 --ef $8 --aspnetruntime $9 --aspnetref ${10} --helixTimeout ${11}" +$DOTNET_ROOT/dotnet run --project RunTests/RunTests.csproj -- --target $1 --runtime $4 --queue $5 --arch $6 --quarantined $7 --ef $8 --aspnetruntime $9 --aspnetref ${10} --helixTimeout ${11} exit_code=$? echo "Finished tests...exit_code=$exit_code" diff --git a/eng/targets/Helix.props b/eng/targets/Helix.props index 1c6206291be9..032bcd49285e 100644 --- a/eng/targets/Helix.props +++ b/eng/targets/Helix.props @@ -22,7 +22,6 @@ false false 10.15.3 - 5.0.0-ci false diff --git a/eng/targets/Helix.targets b/eng/targets/Helix.targets index 0743963a02a9..24baa2b27652 100644 --- a/eng/targets/Helix.targets +++ b/eng/targets/Helix.targets @@ -16,10 +16,6 @@ - - - - @@ -91,11 +87,23 @@ Usage: dotnet msbuild /t:Helix src/MyTestProject.csproj - - + + + + + + + + + @@ -117,8 +125,8 @@ Usage: dotnet msbuild /t:Helix src/MyTestProject.csproj $(TargetFileName) @(HelixPreCommand) @(HelixPostCommand) - 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) - ./runtests.sh $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppRuntimeVersion) $(_HelixFriendlyNameTargetQueue) $(TargetArchitecture) $(RunQuarantinedTests) $(DotnetEfPackageVersion) Microsoft.AspNetCore.App.Runtime.win-x64.$(AppRuntimeVersion).nupkg Microsoft.AspNetCore.App.Ref.$(AppRuntimeVersion).nupkg $(HelixTimeout) + 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) + ./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) $(HelixCommand) $(HelixTimeout)