Skip to content

Commit 45c2eb4

Browse files
Copilotnkolev92
andauthored
Fix BuildAssetsUtilsTests to not depend on host machine envvars
Use SettingsUtility.GetGlobalPackagesFolder with an empty IEnvironmentVariableReader so the test doesn't pick up the NUGET_PACKAGES environment variable from the host machine. Agent-Logs-Url: https://github.com/NuGet/NuGet.Client/sessions/e7319773-b4d6-448e-b48f-96427c36f739 Co-authored-by: nkolev92 <2878341+nkolev92@users.noreply.github.com>
1 parent 0f585d9 commit 45c2eb4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

test/NuGet.Core.Tests/NuGet.Commands.Test/BuildAssetsUtilsTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
using NuGet.Repositories;
1919
using NuGet.Test.Utility;
2020
using NuGet.Versioning;
21+
using Test.Utility;
2122
using Xunit;
2223

2324
namespace NuGet.Commands.Test
@@ -177,7 +178,7 @@ public void BuildAssetsUtils_ReplaceWithUserProfileMacro()
177178
// Arrange
178179
using (var randomProjectDirectory = TestDirectory.Create())
179180
{
180-
var globalPackagesFolder = SettingsUtility.GetGlobalPackagesFolder(NullSettings.Instance);
181+
var globalPackagesFolder = SettingsUtility.GetGlobalPackagesFolder(NullSettings.Instance, TestEnvironmentVariableReader.EmptyInstance);
181182

182183
if (!string.IsNullOrEmpty(globalPackagesFolder))
183184
{

0 commit comments

Comments
 (0)