-
Notifications
You must be signed in to change notification settings - Fork 349
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 type safe protobuf client in test framework #5682
Use type safe protobuf client in test framework #5682
Conversation
ee643c9
to
7425298
Compare
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.
Great stuff! 🥳
Reviewed 11 of 13 files at r1, 2 of 2 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @MarkusPettersson98)
test/test-manager/src/tests/account.rs
line 264 at r3 (raw file):
tokio::time::sleep(THROTTLE_RETRY_DELAY).await; } Err(err) => return Err(err),
Does not truly matter, but it bothers me that we're using return
here but break
below for no good reason. 😅
test/test-manager/src/tests/mod.rs
line 129 at r3 (raw file):
.await .context("Could not clear split tunnel apps in cleanup")?; #[cfg(not(target_os = "macos"))]
This should only called on Linux.
7425298
to
f768135
Compare
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.
Reviewable status: 12 of 14 files reviewed, 1 unresolved discussion (waiting on @dlon)
test/test-manager/src/tests/account.rs
line 264 at r3 (raw file):
Previously, dlon (David Lönnhager) wrote…
Does not truly matter, but it bothers me that we're using
return
here butbreak
below for no good reason. 😅
Yeah, changed this return
to a break
for consistency 😅
test/test-manager/src/tests/mod.rs
line 129 at r3 (raw file):
Previously, dlon (David Lönnhager) wrote…
This should only called on Linux.
🤦
Fixed!
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.
Reviewed 2 of 2 files at r4, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved
6023cc7
to
8c1e963
Compare
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.
Reviewed 1 of 1 files at r5, 3 of 3 files at r6, 1 of 1 files at r7, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved
Re-write some code in the test framework to prefer the type safe wrapper around the Mullvad app gRPC client instead of its auto-generated dito. `ManagementServiceClient` is automatically generated from the protobuf definitions found in `management_interface.proto`, and contains some very crude types. The `MullvadProxyClient` is a type-safe wrapper around `ManagementServiceClient` which performs conversions & validation of the data types from the gRPC server (the daemon) to their respective mappings in the `talpid-*` and `mullvad-*` crates. These types are more ergonomic to work with, and since we already have the conversions in place we should prefer those.
8c1e963
to
87a7650
Compare
Re-write some code in the test framework to prefer the type safe wrapper around the Mullvad app gRPC client instead of its auto-generated dito.
ManagementServiceClient
is automatically generated from the protobuf definitions found inmanagement_interface.proto
, and contains some very crude types. TheMullvadProxyClient
is a type-safe wrapper aroundManagementServiceClient
which performs conversions & validation of the data types from the gRPC server (the daemon) to their respective mappings in thetalpid-*
andmullvad-*
crates. These types are more ergonomic to work with, and since we already have the conversions in place we should prefer those.This PR also adds a
clippy.toml
to the test framework workspace. The only configuration for now is the lintdisallowed-types
which will warn on use ofManagementServiceClient
.This change is