Add webrtc transport multidim interop#100
Conversation
63efd23 to
eb1ab42
Compare
|
🚀 let me know once this is ready for a review. |
e26ca25 to
ffdaea7
Compare
|
@mxinden thanks, ready! @MarcoPolo the tests are failing because of the "js-v0.41.0 x js-v0.41.0 (ws, noise, yamux)" which this PR doesn't affect afaict do you know what might it be? |
|
Can you rebase please. The ping succeeded, but the test failed. I think it’s because it failed when closing the Redis client (which is fine). |
c0a5ace to
03721b7
Compare
mxinden
left a comment
There was a problem hiding this comment.
Minor comments. Good to merge from my end.
| let timeout = Duration::from_secs(5); | ||
|
|
||
| match secure_channel_param { | ||
| "noise" => builder |
There was a problem hiding this comment.
As an aside, I suggest using enums here long-term instead of passing around strings. clap should make this reasonably easy. Neither important nor urgent.
There was a problem hiding this comment.
yup, awesome idea! Updated ptal Max
multidim-interop/src/generator.ts
Outdated
| await db.all(`SELECT DISTINCT a.id as id1, b.id as id2, a.transport | ||
| FROM transports a, transports b | ||
| WHERE a.transport == b.transport | ||
| -- Only webtransport transports |
There was a problem hiding this comment.
| -- Only webtransport transports | |
| -- Only webrtc transports |
|
CC @thomaseizinger you also probably want to take a look, as this builds on your work on the previous interop tests |
6ffa98e to
f999445
Compare
to allow us add the WebRTC transport test (which is only available with the tokio runtime) Clean up the test and update Cargo.toml to 0.2.0 to avoid conflicting with the older tests, and allow us to import lib.rs on the rust-libp2p repo and have the master tests there.
with KeepAlive Behaviour
webrtc instead of webtransport.
fe8e932 to
b251928
Compare
b251928 to
396c327
Compare
multidim-interop/src/generator.ts
Outdated
| listenerID: test.id2, | ||
| transport: test.transport, | ||
| muxer: "quic", | ||
| security: "tls", |
There was a problem hiding this comment.
@MarcoPolo what do you think of this change? It doesn't break Go quic tests, and allows Rust to have one less Variant in the enum. Plus I'd say it makes sense semantically.
There was a problem hiding this comment.
I don’t think it makes sense. In every other context tls means add a tls encryption layer on top of the transport.
I know quic uses tls underneath and that isn’t a hardcoded decision (some different encryption layer could be possible in the future). But for now I think we should keep tls meaning add a tls security layer to the transport.
There was a problem hiding this comment.
yeah you are right Marco, I reverted it int this PR so we can merge and address the rust-libp2p interop. But I also agree with @thomaseizinger on #100 (comment) if you agree we can submit a PR not using muxer nor transport for quic and webrtc cases
thomaseizinger
left a comment
There was a problem hiding this comment.
Some thoughts, otherwise LGTM.
| let transport_param: testplan::Transport = env::var("transport") | ||
| .context("transport environment variable is not set")? | ||
| .parse() | ||
| .context("unsupported transport")?; | ||
|
|
||
| let secure_channel_param: testplan::SecProtocol = env::var("security") | ||
| .context("security environment variable is not set")? | ||
| .parse() | ||
| .context("unsupported secure channel")?; | ||
|
|
||
| let muxer_param: Muxer = env::var("muxer") | ||
| .context("muxer environment variable is not set")? | ||
| .parse() | ||
| .context("unsupported muxer")?; |
There was a problem hiding this comment.
Until we move the test to our repository (where we deduplicate the test using Git revisions), I don't think it makes much sense to be typed here because we have to repeat it in every test.
There was a problem hiding this comment.
it's now all on the testplans lib, which we can depend on the rust-libp2p repo and use from there wdyt?
update: wrote this before reading libp2p/rust-libp2p#3331 (comment) let's continue there.
| muxer: "quic", | ||
| security: "quic", |
There was a problem hiding this comment.
This is a bit odd, I think leaving these blank would make the most sense. It requires the tests to parse the variables in steps but I don't see why that is necessarily a problem.
There was a problem hiding this comment.
Yeah agree Thomas, commented on #100 (comment)
There was a problem hiding this comment.
I think this makes sense to me. We can make this change in a future PR so we do it across all impls
| use testplan::{run_ping_redis, PingSwarm}; | ||
| use testplan::{run_ping, Muxer, PingSwarm, SecProtocol, Transport}; | ||
|
|
||
| fn build_builder<T, C>( |
There was a problem hiding this comment.
This function doesn't have much value because the type constraints are so insane. You are likely better off by just inlining things and accepting the duplication between the different invocations.
There was a problem hiding this comment.
I still feel it's more lines of code and repetition, but feel free to submit a PR addressing that after Thomas
multidim-interop/rust/src/lib.rs
Outdated
| Quic, | ||
| Webrtc, |
There was a problem hiding this comment.
These aren't strictly muxers. I think we should leave the muxer variable empty when we don't explicitly set one. IMO, that will be cleaner implementation.
There was a problem hiding this comment.
yeah makes sense, thanks Thomas addressed :)
- undo generator changes, let's do that later on - don't parse muxer and sec protocol where we don't need it
mxinden
left a comment
There was a problem hiding this comment.
Changes here look good to me. Ready to merge from my end.
@MarcoPolo any objections?
multidim-interop/src/generator.ts
Outdated
| security: "quic", | ||
| }))) | ||
| .concat(webrtcQueryResults | ||
| .map((test): ComposeSpecification => buildSpec(containerImages, { |
There was a problem hiding this comment.
Can we indent this line? The map applies to webrtcQueryResults not the concat(...) expression like above.
There was a problem hiding this comment.
yup makes sense Marco, updated :)
|
@jxs two approvals, all checks are green. Please merge once this is ready from your end. |
- Added in libp2p#2622 - Interoperability tests added in libp2p/test-plans#100
- Added in #2622 - Interoperability tests added in libp2p/test-plans#100
* update interop rust test lib to use tokio to allow us add the WebRTC transport test (which is only available with the tokio runtime) Clean up the test and update Cargo.toml to 0.2.0 to avoid conflicting with the older tests, and allow us to import lib.rs on the rust-libp2p repo and have the master tests there. * simplify build_builder function * replace deprecated ping keepalive with KeepAlive Behaviour * add WebRTC support for rust tests * add webrtc support on interop generator. * fix typo on generators.ts webrtc instead of webtransport. * update rust test plans to use enums instead. * update rust tests enum to match the ones by generator.ts * fix webrtc testcases to have proper security and muxer. * review: address suggestions: - undo generator changes, let's do that later on - don't parse muxer and sec protocol where we don't need it * ident generator.ts.
No description provided.