-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add a fuller integration test, and multiple minor changes to support it #56
Merged
sergiusens
merged 5 commits into
canonical:main
from
tigarmo:CRAFT-1649-integration-test
Apr 17, 2023
Merged
Add a fuller integration test, and multiple minor changes to support it #56
sergiusens
merged 5 commits into
canonical:main
from
tigarmo:CRAFT-1649-integration-test
Apr 17, 2023
Conversation
This file contains 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
The main motivation is to facilitate mocking the default paths in tests, but this follows our standard of using Optionals for parameters that are, well, optional.
AptKeyManager.is_key_installed() was a classmethod and had a parameter with the path to search. However, the function is only ever called with an instance of the class, and then the parameter is misleading because the instance already has its own keyring path. Now AptKeyManager instances will look for keys inside their own _keyrings_path.
tigarmo
force-pushed
the
CRAFT-1649-integration-test
branch
from
April 13, 2023 18:09
2899b0c
to
ab86690
Compare
Codecov Report
@@ Coverage Diff @@
## main #56 +/- ##
==========================================
+ Coverage 83.96% 84.03% +0.06%
==========================================
Files 13 13
Lines 786 789 +3
Branches 182 181 -1
==========================================
+ Hits 660 663 +3
Misses 89 89
Partials 37 37
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
tigarmo
force-pushed
the
CRAFT-1649-integration-test
branch
from
April 13, 2023 18:18
ab86690
to
40e24ed
Compare
The test calls repo.install() to verify the integrated behavior of AptKeyManager, AptSourceManager and AptPreferencesManager. It does some mocking of default paths because repo.install() doesn't take a "base" directory, and the intention of this commit is to check the code without changing its behavior.
This is a leftover from the code move; the rest of the code is already using "craft-" as a prefix. As this is an internal change, no clients are expected to break.
tigarmo
force-pushed
the
CRAFT-1649-integration-test
branch
from
April 13, 2023 18:26
40e24ed
to
1a7d636
Compare
lengau
approved these changes
Apr 17, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thank you!
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 PR's main purpose is to add an integration test that exercises
repo.install()
covering the repository types that we currently support. In order to do this, I had to make multiple minor changes. The updates are applied over a handful of self-confined commits, which I hope will make the review easier. At merge time we can keep them as-is or squash 'em all, I don't have a strong preference either way.CRAFT-1649
CRAFT-1682