ping/rust: introduce rust cross-version test#26
Conversation
| # CARGO_PATCH = """ | ||
| # [patch.crates-io] | ||
| # libp2pv0450 = { package = "libp2p", git = "{{ or .Env.GitTarget "https://github.com/libp2p/rust-libp2p" }}", branch = "master" } | ||
| # """ |
There was a problem hiding this comment.
@mxinden fyi, that's how we could get master & current groups as far as I understand, but I get this for now:
Caused by:
The patch location `https://github.com/libp2p/rust-libp2p` does not appear to contain any packages matching the name `libp2p`.
There was a problem hiding this comment.
That is surprising to me. The below works fine in a project of mine:
+
+[patch.crates-io]
+libp2p = { package = "libp2p", git = "https://github.com/libp2p/rust-libp2p", branch = "master" }Maybe related to the libp2pv0450 rename?
There was a problem hiding this comment.
Is this missing the .git suffix, i.e.git = "https://github.com/libp2p/rust-libp2p.git?
812d202 to
9375005
Compare
|
@laurentsenta just as a heads up, I am looking into cleaning up |
|
Pushed my latest work, mostly refactoring Running |
|
Update: I started working on running multiple iterations with different latencies, the correspondent Rust code to the Go code below. It works with 4 Rust instances. Still needs some clean-up. Lines 251 to 286 in eee18f0 @laurentsenta could you prepare a composition file with both a Rust and a Golang node? That would help testing interoperability of the |
|
I pushed the code needed to run multiple iterations of the ping test. It should now be interoperable with the Golang implementation, though thus far I have only tested it across different Rust versions. |
ping/rust/Cargo.toml
Outdated
| # Note: if this version doesn't match EXACTLY the testground one, I got errors. | ||
| # Is it possible we get similar issues with libp2p dependencies? |
There was a problem hiding this comment.
Yes, that is expected behavior. In case we ever hit the same issue with libp2p we can differentiate by version via the passed in libp2p feature flag.
|
@mxinden I added the testground-related content, # from the test-plans folder, import the plans (once)
testground plan import --from ./ --name libp2p
# then run the simple composition
testground run composition -f ping/_compositions/go-rust-interop-latest.toml --wait I have a more complex test ready, BUT the simple one is not passing yet, This is the error I get: I'm looking into it, one thing to note, it looks like the rust test publishes a raw string address ( |
mxinden
left a comment
There was a problem hiding this comment.
@laurentsenta thanks for merging the JSON changes and the iteration fix.
Should I test this locally or did you already get to it?
| .parse() | ||
| .unwrap(); | ||
|
|
||
| for i in 1..iterations + 1 { |
- Showcase version selection through features Can be run with `cargo check --features libp2pv0450` or `cargo check --features libp2pv0440`. - Peer programming session
Potentially allows caching.
Building the binary in release mode is enough.
9d23dbc to
139dc58
Compare
a6137e7 to
8e33cce
Compare
|
Marking this as ready for review, we had a call with @mxinden and decided we can merge, try rust - go interop on rust-libp2p, and improve performance. |
8e33cce to
dcce2f5
Compare
mxinden
left a comment
There was a problem hiding this comment.
Cool. Let's go ahead here and iterate on it afterwards.
| - Do once, from the test-plans root: import the test-plans with `testground plan import ./ --name libp2p` | ||
| - Run the test with `testground run composition -f ping/_compositions/go-cross-versions.toml --wait` | ||
|
|
||
| ## How to add a new version to ping/rust |
|
Runs:
go-libp2p v0.22 broke the test, I (we) need to update these. |
* ping/go: fix composition name * ping/rust: introduce the ping/rust test * Showcase version selection through features Can be run with `cargo check --features libp2pv0450` or `cargo check --features libp2pv0440`. * Peer programming session * ping/rust: experiment with master & current groups * ping/rust/src/main: Simplify import across versions * ping/rust/src/main: Remove commented out code * ping/rust/src/main: Clean up * ping/rust/Dockerfile: Update crates.io index in separate step Potentially allows caching. * ping/rust/Dockerfile: Don't both build and install Building the binary in release mode is enough. * ping/rust/src/main: Clean up log lines * ping/rust: Implement iterations with latency * ping/rust/src/main: Extract signal and wait logic into fn * ping/rust/Dockerfile: import caching fixes * ping/: add cross-version composition * ping/rust: add json payloads fix * ping/rust: match iterations id with go * ping/rust/Dockerfile: improve caching * ci: introduce workflow ping-interop-rust * ping/interop: update latest versions * ping/_compositions: add full ping interop * ci: resolve git reference to sha * ping/rust/Dockerfile: drop cargo output * ping/rust: drop version indirection * ping/rust/Dockerfile: fix features to support caching * ping/rust/Dockerfile: do not cache the rewritten package * ping/_compositions/*: use concurrent_builds * ping/_compositions/*: drop test_instances count * ci: build composition then run * ping: introduce InteropTarget option * ci: fix interop target & build * ping/_compositions/*: introduce load_resource * ci: 10 minutes timeout for the run step * README: add update instruction for rust & clean go * ping/rust/Dockerfile: add protocol buffer compiler * ping/rust/Cargo.lock: cargo update packages * .github: increase testground timeout Co-authored-by: Max Inden <mail@max-inden.de>
pingtest with a rust version.Rust ping test:
We add a
ping/rustsource folder. This test follows the workflow implemented byping/gowhich means they may be combined.Cargo.tomlDockerfile.Testground compositions
Test outputs are shown on the testground dashboard (localhost:8042 for a default daemon that runs locally).
ping/_compositions/rust-cross-versions.tomlGoal: test different rust-libp2p versions together.
This composition tests v0.44.0, v0.45.1, v0.46.0, master, and an optional branch:
Usage:
ping/_compositions/go-rust-interop-latest.tomlGoal: test latest go and rust libp2p versions together.
This composition tests rust master, and go master and a custom branch either go or rust.
Usage:
ping/_compositions/go-rust-interop.tomlGoal: every known go and rust versions together.
This composition combines the version from both rust and go,
Usage:
CI
This action will build & run the test.
Todo: