testground: cross-version interoperability#23
Conversation
27447ba to
30f20cf
Compare
352e6df to
82b1dee
Compare
ff2b51d to
b58be4b
Compare
|
Unfortunately, I won't be able to meaningfully review this before my short break (until May 4). I'm OK with you moving forward with this though and I can review it post-merge. |
b58be4b to
a55cb01
Compare
marten-seemann
left a comment
There was a problem hiding this comment.
Not an in-depth review yet, but a few high-level thoughts:
- iiuc, the current setup is limited to testing interop between exactly 2 version. It would be nice to have a setup where we could spin up nodes using multiple different versions, especially as we're going to cut more (and smaller) releases in the future. Is that possible?
- code reuse: it would be nice if we could write the code once, and then run it using multiple version. In my mind, this raises two questions:
- What if a breaking API change happened between two versions?
- How to deal with go.mod
I don't have a good answer for 2., but for 1., it might be nice to use a build flag. The implementation could then work around the breaking interface change.
|
2022-05-27 conversation: there was a verbal call on how to move forward. I'm going to move this to draft. Please publish @laurentsenta again when it's ready for review. |
5639ccc to
9fb4d5d
Compare
e727fdc to
7259f78
Compare
936c9ba to
27a7faa
Compare
27a7faa to
97cf122
Compare
97cf122 to
785c9fa
Compare
|
2 updates:
A few runs as example:
|
|
@laurentsenta once this is merged, I can provide the ping Rust implementation based on https://github.com/mxinden/test-plans/tree/compatibility-libp2p. Would appreciate some help hooking it up to the composition test though. |
Great that we can move back to the standard runners now but let's track the setup times and have it on a radar because extending timeouts is not a great long-term solution. Awesome work Laurent ❤️ Let's get it out 🚀 |
marten-seemann
left a comment
There was a problem hiding this comment.
LGTM, modulo a few comments.
Slight improvement would be to use the latest patch release of every minor release (e.g. v0.19.4 instead of v0.19.0).
ping/go/main.go
Outdated
| "github.com/libp2p/go-libp2p-core/peer" | ||
|
|
||
| "github.com/libp2p/go-libp2p-noise" | ||
| noise "github.com/libp2p/go-libp2p-noise" |
There was a problem hiding this comment.
This repo is deprecated as of v0.20.0. Same for -tls.
To do things the correct way, we should define a NoiseProtocolID in compat.
ping/go/main.go
Outdated
| security = libp2p.Security(noise.ID, noise.New) | ||
| case "tls": | ||
| security = libp2p.Security(tls.ID, tls.New) | ||
| // TODO: check w/Marten this is fine: We fall into the lowest common denominator for parameters (here, no secio anymore even for legacy versions). |
There was a problem hiding this comment.
Yes, no need to test secio any more.
|
|
||
| [builders."docker:go"] | ||
| enabled = true | ||
| build_base_image = "golang:1.17-buster" |
There was a problem hiding this comment.
This might be a dumb question, but what does it mean to specify golang:1.17 here?
There was a problem hiding this comment.
Not dumb at all, it becomes the new default for this test plan, (testground uses 1.16 by default).
We overwrite it in the composition files when we run "real" tests.
I assume if you're trying to run a quick test, you're probably working on the latest version,
so you have one less testground parameter to remember:
testground run single --plan=libp2p/ping/go --testcase=ping --builder=docker:go --runner=local:docker --instances=2 --build-cfg modfile=my.new.go.mod
There was a problem hiding this comment.
That's why I was wondering, the current version is Go 1.18. Not a blocker for this PR though.
0f506ec to
7986861
Compare
* plan/ping: fix test & use go 1.17 * plan/ping: fix dedup path * ping-interop: prepare base module and build script * ping-interop/go-v0.11: introduce legacy ping test (fix original) * ci: add interop reusable workflow * ci: add testground endpoint config * ping-interop: rewrite with new testground build config feature * ping-interop: add v0.20 version * ping-interop: fix build parameters * ci: add ping-interop-go runner * ci: use self hosted runner * ping-interop: name with the current git branch * ping-interop: use external proxy & drop build cache * ping-interop: support dependencies changes in go master * ping-interop: using longer timeout with regulars runners * ping-interop: move to ping * README: add ping/go update intructions * ci: rename compatibility test * ci: add support for forks * ping: add doc * REMOVEME: use a test setup * ping: update libp2p versions * ping: add security compat * ping: smaller compat surface
Add a
pingtest, and the composition file to build and run it with different versions of go-libp2p.General idea:
Content
go test:
We add a single
ping-interop/gotest. This test can use multiple versions of libp2p with a single codebase:go.vxxx.modfile (and it's sum) for each version,compatmodule that provides a compatibility layer when there are API changes (shims).Testground composition
We add a testground composition file
go-cross-versions.tomlthat runs v0.11, v.0.17, v0.19, v0.20, the current
master, and an optional branch (ifGitReferenceis in the environment) together.Locally you can run this with:
GitReference=optionnal-custom-libp2p-branch testground run composition \ -f ./_compositions/go-cross-versions.toml \ --collect --waitThen the test output is shown on the testground dashboard (localhost:8042 for a default daemon that runs locally).
Beware of testground/testground#1329 when you check results.
Note it'll use a go mod
replaceto test the latest master and latest version of an optional branch.CI
We define a reusable workflow we can from another repository, it's called with:
This action will build & run the test.
Todo:
DEBUGcommits used for testing