mirror of
https://github.com/status-im/libp2p-test-plans.git
synced 2025-02-19 18:18:25 +00:00
This commit disables the WebRTC tests for rust-libp2p v0.50.0 and v0.51.0 and chromium-js v0.41.0 and v0.42.0. Neither of these support the new `/webrtc-direct` (see https://github.com/multiformats/multiaddr/pull/150/#issuecomment-1468791586 for context on rename). The missing support is blocking https://github.com/libp2p/rust-libp2p/pull/3688 namely to upgrade to using `/webrtc-direct`. (Note that this is only blocking CI. Users can already use `/webrtc-direct` with the latest released rust-libp2p.) We will backport `/webrtc-direct` support to the rust-libp2p `v0.51.0` interop binary and then re-enable it here. Instead of disabling the versions with missing support for `/webrtc-direct` we could as well patch our interoperability test logic. For the sake of simplicity, I am proposing simply disabling the versions for now.
Interoperability test
This tests that different libp2p implementations can communicate with each other on each of their supported capabilites.
Each version of libp2p is defined in versions.ts
. There the version defines
its capabilities along with the id of its container image.
Test spec
The implementation is run in a container and is passed parameters via environment variables. The current parameters are:
Name | Description | Is Optional |
---|---|---|
transport | The transport to use | no |
muxer | The muxer to use | no, except when transport is one of quic, quic-v1, webtransport |
security | The security channel to use | no, except when transport is one of quic, quic-v1, webtransport |
is_dialer | Should you dial or listen | no |
ip | IP address to bind the listener to | yes, default to "0.0.0.0" |
redis_addr | A different address to connect to redis (default redis:6379) | yes, default to the redis host on port 6379 |
test_timeout_seconds | Control the timeout of test. | yes, default to 180 seconds. |
The test should do two different things depending on if it's the dialer or listener.
Dialer
The dialer should emit all diagnostic logs to stderr
. Only the final JSON
string result should be emitted to stdout
.
- Connect to the Redis instance.
- Create a libp2p node as defined by the environment variables.
- Get the listener's address via Redis'
BLPOP
using thelistenerAddr
key. - Record the current instant as
handshakeStartInstant
. - Connect to the listener.
- Ping the listener, and record the round trip duration as
pingRTT
- Record the duration since
handshakeStartInstant
. This ishandshakePlusOneRTT
. - Print to
stdout
the JSON formatted string:{"handshakePlusOneRTTMillis": handshakePlusOneRTT, "pingRTTMilllis": pingRTT}
. Durations should be printed in milliseconds as a float. - Exit with a code zero.
On error, the dialer should return a non-zero exit code.
Listener
The listener should emit all diagnostic logs to stderr
.
- Connect to the Redis instance.
- Create a libp2p node as defined by the environment variables.
- Publish the listener's address via Redis'
RPUSH
using thelistenerAddr
key. - Sleep for the duration of
test_timeout_seconds
. The test runner will kill this process when the dialer finishes. - If the timeout is hit, exit with a non-zero error code.
On error, the listener should return a non-zero exit code.