-
Notifications
You must be signed in to change notification settings - Fork 382
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 API access method tests #5798
Add API access method tests #5798
Conversation
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 3 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @MarkusPettersson98)
test/test-manager/src/tests/access_methods.rs
line 59 at r1 (raw file):
let bridge = relay_list .relays() .filter(|relay| matches!(relay.endpoint_data, RelayEndpointData::Bridge))
This should probably filter on active
too. Maybe it should also select a random relay to avoid the problem we had earlier.
1f44008
to
2cfe49e
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 r2, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved
509fb32
to
34c0754
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 3 of 3 files at r3, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved
f3e7806
to
ea54490
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 2 of 2 files at r4, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @MarkusPettersson98)
test/.cargo/config.toml
line 5 at r4 (raw file):
[env] LIBMNL_LIB_DIR = { value = "../dist-assets/binaries", relative = true }
Awesome. I wonder if we can just use this in the main workspace as well (instead of using env.sh
).
Is setting SDKROOT
required for macOS?
307ea7e
to
dbfcb44
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 2 of 2 files at r5, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @MarkusPettersson98)
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 8 of 8 files at r6, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @MarkusPettersson98)
talpid-future/src/lib.rs
line 4 at r6 (raw file):
#![deny(missing_docs)] pub mod future_retry;
Nit: future_
could probably be removed?
4622fff
to
e3681f9
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 8 of 8 files at r7, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @MarkusPettersson98)
3be8a7c
to
6c69738
Compare
965e563
to
2cbd204
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 15 of 15 files at r8, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved
af16fd5
to
0b88707
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 6 of 6 files at r9, 2 of 2 files at r11, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @MarkusPettersson98)
mullvad-api/src/lib.rs
line 177 at r11 (raw file):
disable_tls: false, force_direct: force_direct .map(|force_direct_env| force_direct_env.to_lowercase() != "false")
We seem to check if var != "0"
for other boolean env vars. false
might be objectively better, but it's inconsistent, so maybe we should stick to 0?
mullvad-daemon/src/api.rs
line 247 at r9 (raw file):
let (index, next) = Self::get_next_inner( access_method_settings.cardinality(),
Off by one?
test/test-manager/src/tests/ui.rs
line 167 at r9 (raw file):
// `MULLVAD_API_FORCE_DIRECT=false` and restarting the daemon. let (host, endpoint) = (mullvad_api::API.host(), mullvad_api::API.address());
We should probably take these from TEST_CONFIG
. See get_app_env()
.
test/test-manager/src/tests/ui.rs
line 223 at r11 (raw file):
tokio::time::timeout( std::time::Duration::from_secs(60), rpc.set_daemon_environment(env),
In my opinion, we should either make sure that the test always cleans up the environment, somehow, or set must_succeed = true
on it. Otherwise, we get sort of an inconsistent state for any remaining tests.
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: all files reviewed, 3 unresolved discussions (waiting on @MarkusPettersson98)
mullvad-api/src/lib.rs
line 256 at r11 (raw file):
]; if env_vars.map(Self::read_var).iter().any(Option::is_some) {
Nice trick!
608d1dd
to
a6b504f
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: 23 of 32 files reviewed, 3 unresolved discussions (waiting on @dlon)
mullvad-api/src/lib.rs
line 177 at r11 (raw file):
Previously, dlon (David Lönnhager) wrote…
We seem to check if
var != "0"
for other boolean env vars.false
might be objectively better, but it's inconsistent, so maybe we should stick to 0?
True, it is better to be consistent. Fixed
mullvad-api/src/lib.rs
line 256 at r11 (raw file):
Previously, dlon (David Lönnhager) wrote…
Nice trick!
Thanks!
mullvad-daemon/src/api.rs
line 247 at r9 (raw file):
Previously, dlon (David Lönnhager) wrote…
Off by one?
This was fixed in a separate PR
talpid-future/src/lib.rs
line 4 at r6 (raw file):
Previously, dlon (David Lönnhager) wrote…
Nit:
future_
could probably be removed?
Done
test/test-manager/src/tests/access_methods.rs
line 59 at r1 (raw file):
Previously, dlon (David Lönnhager) wrote…
This should probably filter on
active
too. Maybe it should also select a random relay to avoid the problem we had earlier.
Solved by using mullvad-relay-selector
test/test-manager/src/tests/ui.rs
line 167 at r9 (raw file):
Previously, dlon (David Lönnhager) wrote…
We should probably take these from
TEST_CONFIG
. Seeget_app_env()
.
Done
test/.cargo/config.toml
line 5 at r4 (raw file):
Previously, dlon (David Lönnhager) wrote…
Awesome. I wonder if we can just use this in the main workspace as well (instead of using
env.sh
).Is setting
SDKROOT
required for macOS?
No longer relevant
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: 23 of 32 files reviewed, 3 unresolved discussions (waiting on @dlon)
test/test-manager/src/tests/ui.rs
line 223 at r11 (raw file):
Previously, dlon (David Lönnhager) wrote…
In my opinion, we should either make sure that the test always cleans up the environment, somehow, or set
must_succeed = true
on it. Otherwise, we get sort of an inconsistent state for any remaining tests.
Done by settings must_succeed = 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.
Reviewed 1 of 1 files at r12, 8 of 9 files at r13, 1 of 1 files at r14, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved
Refactor some parts of `talpid-core` to `talpid-future`.
Add Shadowsocks & SOCKS5 (remote) access method tests. Simply try to access the Mullvad API using these custom access methods.
Since `test_custom_access_methods_ui` may fail after messing with the test runner environment, we want to fail fast and abort the entire test run if the test fails before managing to clean up.
23e9644
to
6980530
Compare
This PR add tests for custom API access methods to the integration test suite.
This change is