Skip to content

Move the nuget cache creation into the work item creation class #26764

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions build/RunTestsOnHelix.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,4 @@ REM call dotnet new so the first run message doesn't interfere with the first te
dotnet new --debug:ephemeral-hive
REM avoid potetial cocurrency issues when nuget is creating nuget.config
dotnet nuget list source
REM We downloaded a special zip of files to the .nuget folder so add that as a source
dotnet nuget add source %DOTNET_ROOT%\.nuget
dir /B %DOTNET_ROOT%\.nuget
dir /B %DOTNET_ROOT%\.nuget
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ private async Task<List<ITaskItem>> PrepareWorkItem(ITaskItem xunitProject)

string msbuildAdditionalSdkResolverFolder = netFramework ? "-e DOTNET_SDK_TEST_MSBUILDSDKRESOLVER_FOLDER=%HELIX_CORRELATION_PAYLOAD%\\r" : IsPosixShell ? "" : "-msbuildAdditionalSdkResolverFolder %HELIX_CORRELATION_PAYLOAD%\\r";

// We want to add a nuget cache for predownloaded runtime packages but this appears to break the packageinstall tests. For now only enable on windows
string localNugetCache = IsPosixShell || assemblyName.Contains("Microsoft.DotNet.PackageInstall.Tests") ? "" : "dotnet nuget add source %DOTNET_ROOT%\\.nuget & ";

var scheduler = new AssemblyScheduler(methodLimit: 32);
var assemblyPartitionInfos = scheduler.Schedule(targetPath, netFramework: netFramework);

Expand All @@ -143,6 +146,8 @@ private async Task<List<ITaskItem>> PrepareWorkItem(ITaskItem xunitProject)
command = $"{driver} test {assemblyName} {testExecutionDirectory} {msbuildAdditionalSdkResolverFolder} {(XUnitArguments != null ? " " + XUnitArguments : "")} --results-directory .\\ --logger trx {testFilter}";
}

command = localNugetCache + command;

Log.LogMessage($"Creating work item with properties Identity: {assemblyName}, PayloadDirectory: {publishDirectory}, Command: {command}");

TimeSpan timeout = TimeSpan.FromMinutes(5);
Expand Down