Repository navigation
Add PackageRepository.Package overload that accept .nupkg file - #276
Merged
Merged
Conversation
Contributor
Author
|
Let me know if you disagree with this idea. I think it's a simpler way to consume a .nupkg file in tests without needing to make the API more complicated by also supporting package source mappings. I can still go that route instead if you prefer. |
jeffkl
approved these changes
Mar 8, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change inspired from the discussion in #265.
The overall goal is to make it easier to produce packages as part of a solution and then run integration tests. As mentioned in the linked issue, NuGet packages are supposed to be immutable, and thus ensuring that the correct version of the package is being used and tested is critical.
Rather than use NuGet source mappings or other techniques to ensure the correct package is installed, introduce an overload of
PackageRepository.Package()that accepts aFileInfothat points to a .nupkg file. That package is unpacked and a newPackageis created to hold the unpacked contents.From there tests can proceed as normal, bypassing the need to interact with feeds entirely.
Also added unit tests (using a
PackageFeed.Packageas the source) to validate.