From f86eb17fb4eaed4c5d7028f3948c5689194ec943 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Mon, 20 Apr 2020 19:33:02 -0700 Subject: [PATCH] [Helix] Install ef tool to work item root instead of globally (#21025) --- eng/helix/content/RunTests/TestRunner.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/eng/helix/content/RunTests/TestRunner.cs b/eng/helix/content/RunTests/TestRunner.cs index 43e3cce490..f53a5fabb3 100644 --- a/eng/helix/content/RunTests/TestRunner.cs +++ b/eng/helix/content/RunTests/TestRunner.cs @@ -44,7 +44,7 @@ namespace RunTests EnvironmentVariables.Add("NUGET_FALLBACK_PACKAGES", helixDir); var nugetRestore = Path.Combine(helixDir, "nugetRestore"); EnvironmentVariables.Add("NUGET_RESTORE", nugetRestore); - var dotnetEFFullPath = Path.Combine(nugetRestore, $"dotnet-ef/{Options.EfVersion}/tools/netcoreapp3.1/any/dotnet-ef.exe"); + var dotnetEFFullPath = Path.Combine(nugetRestore, helixDir, "dotnet-ef.exe"); Console.WriteLine($"Set DotNetEfFullPath: {dotnetEFFullPath}"); EnvironmentVariables.Add("DotNetEfFullPath", dotnetEFFullPath); @@ -138,11 +138,10 @@ namespace RunTests errorDataReceived: Console.Error.WriteLine); await ProcessUtil.RunAsync($"{Options.DotnetRoot}/dotnet", - $"tool install dotnet-ef --global --version {Options.EfVersion}", + $"tool install dotnet-ef --version {Options.EfVersion} --tool-path {Options.HELIX_WORKITEM_ROOT}", environmentVariables: EnvironmentVariables, outputDataReceived: Console.WriteLine, - errorDataReceived: Console.Error.WriteLine, - throwOnError: false); // EF tool is sometimes already installed so we can ignore this failure + errorDataReceived: Console.Error.WriteLine); // ';' is the path separator on Windows, and ':' on Unix Options.Path += RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ";" : ":";