-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat: allow use of interceptable mknod
in ProviderService
#607
base: main
Are you sure you want to change the base?
Conversation
Failing integration tests will be fixed by #587 |
"craft-providers @ git+https://github.com/canonical/craft-providers.git@work/CRAFT-2568-settable-mknod-intercept", | ||
#"craft-providers>=2.1.0", |
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.
Reminder to future self: update this once I release a new craft-providers
.
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'd like to see unit tests for the logic, otherwise looks good. Thanks for filling out the docstrings.
@@ -237,7 +237,7 @@ def test_get_lxd_provider(monkeypatch, provider_service, lxd_remote, check): | |||
check.equal(actual, mock_provider.return_value) | |||
with check: | |||
mock_provider.assert_called_once_with( | |||
lxd_project="testcraft", lxd_remote=lxd_remote | |||
lxd_project="testcraft", lxd_remote=lxd_remote, intercept_mknod=True |
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 exercise the default value and setting ProviderService(intercept_mknod)
?
A quick way to do this would be to instantiate a ProviderService like some of the other tests and add something along the lines of @pytest.param("intercept_mknod", [None, True, False])
@@ -68,13 +73,16 @@ def __init__( | |||
build_plan: list[models.BuildInfo], | |||
provider_name: str | None = None, | |||
install_snap: bool = True, | |||
intercept_mknod: bool = True, |
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.
Here and in craft-providers this is set to True
by default. But according to the discussion in canonical/craft-providers#191 I understand the proposition was to set it to False
by default. Is that a mistake or did we change our mind?
return LXDProvider( | ||
lxd_project=self._app.name, | ||
lxd_remote=lxd_remote, | ||
intercept_mknod=self._intercept_mknod, |
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.
nitpick?: I feel like this is an implementation detail, or at least something living at a deeper abstraction level than the other arguments given to the LXDProvider class.
I do not have a good solution and I do not really know if we will ever need to gather other configuration values of this kind at some point in the future but maybe this should be in a "lxd_tuning" object?
tox
?Make use of
craft_providers
's newintercept_mknod
argument toLXDProvider
.canonical/craft-providers#717