-
Notifications
You must be signed in to change notification settings - Fork 442
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
recording: record the packages installed in the machine #1529
Conversation
|
||
with apt.Cache() as apt_cache: | ||
expected_package = 'python3={}'.format( | ||
apt_cache['python3'].installed.version) |
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.
How about checking repo.get_installed_packages as well? My gut feeling is we should also explicitly test that it works correctly (even if the manifest uses it indirectly) - or if not here, in a unit test.
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.
I added a unit test in snapcraft/tests/repo/test_deb.py
@@ -754,16 +753,20 @@ def setUp(self): | |||
'internal', 'repo', 'manifest.txt'))) as manifest_file: | |||
self.add_packages([line.strip() for line in manifest_file]) | |||
|
|||
def add_package(self, package): | |||
package.temp_dir = self.path | |||
self.cache[package.name] = package |
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.
Can you create the FakeaptCachePackage here instead of every call to the function?
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.
I wouldn't want the add_package method to receive all the arguments that FakeAptCachePackage. If you want to just add a package by name you can self.add_packages([test])
. If you need more control than the name, I think it's ok that you instantiate your own.
Maybe that other method should be called add_packages_by_name
.
9080dce
to
ff1f6ad
Compare
ff1f6ad
to
4973a04
Compare
b4f1ccc
to
b3b1a1d
Compare
b3b1a1d
to
aeaa3ff
Compare
./runtests.sh static
?./runtests.sh unit
?This closes #1452.
Requires #1528.