mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-05-12 19:07:14 +00:00
Previously, we would specify the version and path of our workspace dependencies in each of our crates. This is error prone as https://github.com/libp2p/rust-libp2p/pull/3658#discussion_r1153278072 for example shows. Problems like these happened in the past too. There is no need for us to ever depend on a earlier version than the most current one in our crates. It thus makes sense that we manage this version in a single place. Cargo supports a feature called "workspace inheritance" which allows us to share a dependency declaration across a workspace and inherit it with `{ workspace = true }`. We do this for all our workspace dependencies and for the MSRV. Resolves #3787. Pull-Request: #3715.
Interop tests implementation
This folder defines the implementation for the interop tests.
Running this test locally
You can run this test locally by having a local Redis instance and by having another peer that this test can dial or listen for. For example to test that we can dial/listen for ourselves we can do the following:
- Start redis (needed by the tests):
docker run --rm -it -p 6379:6379 redis/redis-stack
. - In one terminal run the dialer:
REDIS_ADDR=localhost:6379 ip="0.0.0.0" transport=quic-v1 security=quic muxer=quic is_dialer="true" cargo run --bin ping
- In another terminal, run the listener:
REDIS_ADDR=localhost:6379 ip="0.0.0.0" transport=quic-v1 security=quic muxer=quic is_dialer="false" cargo run --bin ping
To test the interop with other versions do something similar, except replace one of these nodes with the other version's interop test.
Running all interop tests locally with Compose
To run this test against all released libp2p versions you'll need to have the (libp2p/test-plans)[https://github.com/libp2p/test-plans] checked out. Then do the following (from the root directory of this repository):
- Build the image:
docker build -t rust-libp2p-head . -f interop-tests/Dockerfile
. - Build the images for all released versions in
libp2p/test-plans
:(cd <path to >/libp2p/test-plans/multidim-interop/ && make)
. - Run the test:
RUST_LIBP2P="$PWD"; (cd <path to >/libp2p/test-plans/multidim-interop/ && npm run test -- --extra-version=$RUST_LIBP2P/interop-tests/ping-version.json --name-filter="rust-libp2p-head")