paritytech / polkadot-sdk

The Parity Polkadot Blockchain SDK
https://polkadot.network/
1.62k stars 564 forks source link

Build bridges testing framework #3242

Open serban300 opened 4 months ago

serban300 commented 4 months ago

The bridges test environments are a bit more complex because we need 2 networks plus a relayer

We should build a minimal framework that can start such an environment and then run the tests. We already have some tests here and some scripting around them: https://github.com/paritytech/polkadot-sdk/tree/master/bridges/zombienet . But it would be good to make everything more modular and more extensible.

ggwpez commented 4 months ago

Just bridges? I think @joepetrowski wanted to have a general parachains testing thing. Dont know what you are aiming for here, but maybe it could both be considered.

serban300 commented 4 months ago

Just bridges? I think @joepetrowski wanted to have a general parachains testing thing. Dont know what you are aiming for here, but maybe it could both be considered.

Not sure. For the moment just want to start with some simple scripting in order to be able to spawn a more complex zombienet environment and run some bridge tests. After that we can incrementally improve it and maybe reuse it for parachains.

joepetrowski commented 4 months ago

If you just want Zombienet you should be able to declare a lot with https://github.com/paritytech/parachains-integration-tests. Talk with @NachoPal about it.

Yes for sure we want something more general/extensible too.

serban300 commented 4 months ago

If you just want Zombienet you should be able to declare a lot with https://github.com/paritytech/parachains-integration-tests. Talk with @NachoPal about it.

Thanks ! I didn't know about this tool. Will check it out. This might be very useful !

xlc commented 4 months ago

It should be relatively easy to modify Chopsticks to make it support bridges testing. It won't cover everything but should still be useful for high level runtime XCM testing.

bkontur commented 4 months ago

Also it should be able to run those tests:

serban300 commented 4 months ago

It should be relatively easy to modify Chopsticks to make it support bridges testing. It won't cover everything but should still be useful for high level runtime XCM testing.

That would be great. We intend to also add Chopsticks tests but I didn't get to look on it yet. Will do that after we have some basic zombienet tests running in the CI

acatangiu commented 4 months ago

Chopstix would also allow us to easily (or easier) add regression tests for any real-world encountered issues since it can run from some real chain state (at custom block number do local fork of real chain).

The questions I have (need research) are:

NachoPal commented 4 months ago

Bridging capabilities were added to xcm-emulator. You can start adding tests there also.

About e2e tests:

bkchr commented 4 months ago
  • how do we define tests? we need to integrate with some DSL. (taking it even further, can we unify Zombienet and Chopsticks DSLs?)

We need the same for: https://github.com/polkadot-fellows/runtimes/issues/171

  • Tests written in yaml files.

Please no. Can we stop this right from the start? Looking at the examples gives me headaches.

pepoviola commented 4 months ago

Will do that after we have some basic zombienet tests running in the CI

Hi @serban300, we want to start moving some workloads to the next version of zombienet asap. With the new version you can manage multiple networks (and write test directly in rust or interact with the chain through subxt or polkadot.js)and I think we can help to simplify the current setup. Also, at some point we want to add support for easily integrate Chopsticks with zombienet.

Thx!

serban300 commented 4 months ago

Hi @pepoviola ! Sounds like zombienet v2 might have most of what we need, at least for bridges. I would be interested in migrating one of our current tests to v2 in order understand better how it works. Would this be possible now ? Or is the repo still under development. Also could you show us a migrated workload when available as an example ? Thanks !