Skip to content

Commit 0a181d2

Browse files
committed
Eliminate duplicates in Helix TestRunner
- do not add source that's already in NuGet.config - configuration file now part of Helix content - do not set env variable set in `runtests.*` nit: simplify `%Path% setting in runtests.cmd - always quote the value
1 parent e02820f commit 0a181d2

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

eng/helix/content/RunTests/TestRunner.cs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ public bool SetupEnvironment()
3434
}
3535

3636
EnvironmentVariables.Add("PATH", Options.Path);
37-
EnvironmentVariables.Add("DOTNET_ROOT", Options.DotnetRoot);
3837
EnvironmentVariables.Add("helix", Options.HelixQueue);
3938

4039
Console.WriteLine($"Current Directory: {Options.HELIX_WORKITEM_ROOT}");
@@ -126,14 +125,6 @@ await ProcessUtil.RunAsync($"{Options.DotnetRoot}/dotnet",
126125
throwOnError: false,
127126
cancellationToken: new CancellationTokenSource(TimeSpan.FromMinutes(2)).Token);
128127

129-
await ProcessUtil.RunAsync($"{Options.DotnetRoot}/dotnet",
130-
"nuget add source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json --configfile NuGet.config",
131-
environmentVariables: EnvironmentVariables,
132-
outputDataReceived: Console.WriteLine,
133-
errorDataReceived: Console.Error.WriteLine,
134-
throwOnError: false,
135-
cancellationToken: new CancellationTokenSource(TimeSpan.FromMinutes(2)).Token);
136-
137128
// Write nuget sources to console, useful for debugging purposes
138129
await ProcessUtil.RunAsync($"{Options.DotnetRoot}/dotnet",
139130
"nuget list source",
@@ -199,8 +190,7 @@ public async Task<bool> InstallDotnetDump()
199190
try
200191
{
201192
await ProcessUtil.RunAsync($"{Options.DotnetRoot}/dotnet",
202-
$"tool install dotnet-dump --tool-path {Options.HELIX_WORKITEM_ROOT} " +
203-
"--version 5.0.0-* --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json",
193+
$"tool install dotnet-dump --tool-path {Options.HELIX_WORKITEM_ROOT} --version 5.0.0-*",
204194
environmentVariables: EnvironmentVariables,
205195
outputDataReceived: Console.WriteLine,
206196
errorDataReceived: Console.Error.WriteLine,
@@ -247,7 +237,7 @@ public async Task<int> RunTestsAsync()
247237
{
248238
// Timeout test run 5 minutes before the Helix job would timeout
249239
var cts = new CancellationTokenSource(Options.Timeout.Subtract(TimeSpan.FromMinutes(5)));
250-
var commonTestArgs = $"test {Options.Target} --logger:xunit --logger:\"console;verbosity=normal\" --blame \"CollectHangDump;TestTimeout=5m\"";
240+
var commonTestArgs = $"test {Options.Target} --logger:xunit --logger:\"console;verbosity=normal\" --blame \"CollectHangDump;TestTimeout=5m\"";
251241
if (Options.Quarantined)
252242
{
253243
Console.WriteLine("Running quarantined tests.");
@@ -346,7 +336,7 @@ public void UploadResults()
346336
else
347337
{
348338
Console.WriteLine("No dmps found in TestResults");
349-
}
339+
}
350340
}
351341
}
352342
}

eng/helix/content/runtests.cmd

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
@echo off
2-
REM Need delayed expansion !PATH! so parens in the path don't mess up the parens for the if statements that use parens for blocks
3-
setlocal enabledelayedexpansion
42

53
REM Use '$' as a variable name prefix to avoid MSBuild variable collisions with these variables
64
set $target=%1
@@ -26,8 +24,8 @@ set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
2624
set DOTNET_MULTILEVEL_LOOKUP=0
2725
set DOTNET_CLI_HOME=%HELIX_CORRELATION_PAYLOAD%\home
2826

29-
set PATH=%DOTNET_ROOT%;!PATH!;%HELIX_CORRELATION_PAYLOAD%\node\bin
30-
echo Set path to: %PATH%
27+
set "PATH=%DOTNET_ROOT%;%PATH%;%HELIX_CORRELATION_PAYLOAD%\node\bin"
28+
echo Set path to: "%PATH%"
3129

3230
powershell.exe -noLogo -NoProfile -ExecutionPolicy unrestricted -command ". eng\common\tools.ps1; InstallDotNet %DOTNET_ROOT% %$sdkVersion% %$arch% '' $true '' '' $true"
3331
IF [%$feedCred%] == [] (

0 commit comments

Comments
 (0)