-
Notifications
You must be signed in to change notification settings - Fork 352
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 setup for writing tests for TunnelManager #5232
Add setup for writing tests for TunnelManager #5232
Conversation
485e858
to
9be4c65
Compare
48be1a8
to
8651d05
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 58 of 58 files at r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @buggmagnet)
ios/MullvadVPN/TunnelManager/StopTunnelOperation.swift
line 39 at r1 (raw file):
case .connected, .connecting, .reconnecting, .waitingForConnectivity(.noConnection), .error: guard var tunnel = interactor.tunnel else {
let
should be fine here.
ios/MullvadVPN/TunnelManager/Tunnel.swift
line 23 at r1 (raw file):
} protocol TunnelProtocol: AnyObject, Equatable {
There's quite a lot going on in this protocol. I understand that it's here mainly to facilitate testing (hence this PR), but maybe we should divide it into appropriate chunks now that we're abstracting things anyway?
ios/MullvadVPNTests/RESTRequestExecutor+Stubs.swift
line 36 at r1 (raw file):
guard let success = success else { throw POSIXError(.EINVAL) } return try await withCheckedThrowingContinuation { continuation in
Simplify with return success()
?
8651d05
to
63ae31a
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: 56 of 58 files reviewed, 3 unresolved discussions (waiting on @rablador)
ios/MullvadVPN/TunnelManager/Tunnel.swift
line 23 at r1 (raw file):
Previously, rablador (Jon Petersson) wrote…
There's quite a lot going on in this protocol. I understand that it's here mainly to facilitate testing (hence this PR), but maybe we should divide it into appropriate chunks now that we're abstracting things anyway?
I agree, however it would be outside of the scope of this (already) large PR.
We should definitely do it in a follow up PR instead.
ios/MullvadVPNTests/RESTRequestExecutor+Stubs.swift
line 36 at r1 (raw file):
Previously, rablador (Jon Petersson) wrote…
Simplify with
return success()
?
Done.
I think in the future we will want to make this more configurable for advanced testing.
ios/MullvadVPN/TunnelManager/StopTunnelOperation.swift
line 39 at r1 (raw file):
Previously, rablador (Jon Petersson) wrote…
let
should be fine here.
Done.
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 r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved
As the name implies, this PR makes
TunnelManager
testable. No tests have been ran just yet.This change is