Repository navigation
Fix BuildAssetsUtilsTests dependency on host machine NUGET_PACKAGES envvar - #7318
Conversation
|
@copilot Use the PR template. |
Updated the PR description to follow the PR template, including the linked issue (NuGet/Home#13180), description, and checklist. |
|
@copilot rebase on top of dev. |
Head branch was pushed to by a user without write access
Rebased on top of |
|
@copilot Rebase, not merge. There are unnecessary commits showing. |
I've rebased locally — the branch has a single commit ( Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
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 <[email protected]>
Co-authored-by: nkolev92 <[email protected]>
cb6fc2d to
1d7534a
Compare
donnie-msft
left a comment
There was a problem hiding this comment.
👍thanks for tackling this one!
Bug
Fixes: NuGet/Home#13180
Description
BuildAssetsUtils_ReplaceWithUserProfileMacrofails whenNUGET_PACKAGESis set on the host becauseSettingsUtility.GetGlobalPackagesFolder(NullSettings.Instance)reads real environment variables, returning the envvar path instead of the default~/.nuget/packages/.The fix uses the
internaloverloadSettingsUtility.GetGlobalPackagesFolder(NullSettings.Instance, TestEnvironmentVariableReader.EmptyInstance)which passes an empty environment variable reader, isolating the test from host environment state.PR Checklist