Skip to content
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

Use NuGet.config for restore during package testing #53837

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
9 changes: 1 addition & 8 deletions src/libraries/pkg/test/packageTest.targets
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,7 @@

<PropertyGroup>
<ToolsDir>$(MSBuildThisFileDirectory)tools\</ToolsDir>

<RestoreSources>
https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json;
https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json;
https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json;
https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6-transport/nuget/v3/index.json;
$(LocalPackagesPath)
</RestoreSources>
<RestoreAdditionalProjectSources>$(LocalPackagesPath)</RestoreAdditionalProjectSources>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: why not replace the LocalPackagesPath property with RestoreAdditionalProjectSources?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think LocalPackagesPath is easier to remember when running package tests locally?

Copy link
Member

@ViktorHofer ViktorHofer Jun 8, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That property isn't supposed to be passed in by the user. It's already passed in and by default points to the artifacts packages dir:

<TestRestoreCommand>$(TestRestoreCommand) /p:LocalPackagesPath=$(ArtifactsPackagesDir)</TestRestoreCommand>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. For some reason I thought it was for local testing, I forgot we generated the test restore command.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifying known properties as global properties can make them effectively readonly in the evaluation, which could break other props/targets which were trying to append to them. This was the case with RestoreSources previously. I'm inclined to keep these seperate since it's not the intent of this to specify all additional restore sources, only one that we want to add.


<!-- Make sure the SDK raises the runtime items so that they are passed to conflict resolution -->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
Expand Down
3 changes: 3 additions & 0 deletions src/libraries/pkg/test/testPackages.proj
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
<TestSupportFiles Include="$(LibrariesProjectRoot)shims\netfxreference.props">
<DestinationFolder>$(TestToolsDir)</DestinationFolder>
</TestSupportFiles>
<TestSupportFiles Include="$(RepoRoot)NuGet.config">
<DestinationFolder>$(TestToolsDir)</DestinationFolder>
</TestSupportFiles>
<TestSupportFiles Include="$(RepositoryEngineeringDir)versions.props">
<DestinationFolder>$(TestToolsDir)eng/</DestinationFolder>
</TestSupportFiles>
Expand Down