Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Tracking issue for translating XCM tests from Zombienet to XCM simulator. #2195

Open
3 tasks
ruseinov opened this issue Feb 16, 2023 · 4 comments
Open
3 tasks
Assignees

Comments

@ruseinov
Copy link
Contributor

ruseinov commented Feb 16, 2023

The goal is to be able to run as many as possible, if not all, XCM tests in the CI, without waiting for services to come up and other pain-points of actually spinning up multiple chains. This will also simplify testing locally, as unit-tests are easier and faster to run. The only concern here is that importing several runtimes might make the compilation pretty slow and resource-hungry, something to take into account.

This way we'll always know if any of the assumptions have changed and communicate that to the teams accordingly. Currently XCM tests reside in integration-tests directory and leverage Zombienet to run, but that has to be run manually.

How to approach this

The idea is to end up with something similar to the example here, introducing dev-dependencies that would import all the relevant runtimes, parachain and relay, as git dependencies, referencing a relative path for each of them and a polkadot master branch. And implement unit-tests per chain for all the scenarios we currently have in integration-tests repo and beyond.

Additionally it would be nice to have those tests comprehensively documented in order to provide meaningful usage examples for the community to take inspiration from.

A list of parachain XCM tests that need to be translated as seen in integration-tests directory:

@bkchr
Copy link
Member

bkchr commented Feb 16, 2023

Zombienet is the way to, but the mentioned integrration tests are using some layer put on top of Zombienet. The solution here should be that we write these XCM in "pure" Zombienet. Currently not that trivial, but you can already "branch out" to some js script where you can use polkadot-js. We should use this way for writing the tests and then we should use the correct Statemine/Statemint/etc runtimes to run these XCM tests in CI.

@ruseinov
Copy link
Contributor Author

Zombienet is the way to, but the mentioned integrration tests are using some layer put on top of Zombienet. The solution here should be that we write these XCM in "pure" Zombienet. Currently not that trivial, but you can already "branch out" to some js script where you can use polkadot-js. We should use this way for writing the tests and then we should use the correct Statemine/Statemint/etc runtimes to run these XCM tests in CI.

The idea behind this issue is to replicate as many of those tests as possible via XCM-simulator in order to have something that documents XCM usage and configuration well for ecosystem teams as discussed with @joepetrowski.
Perhaps implementing the Zombienet tests properly as you mentioned is something that needs to be mentioned in it's own issue and indeed used for the CI, while XCM-simulator tests would be more of a usage example doc for the community.

@joepetrowski would be nice if you could chip in with our vision of the subject.

@bkchr
Copy link
Member

bkchr commented Feb 16, 2023

Okay! Yeah, I also just realized that xcm-simulator is using the runtimes directly. I had thought that this was mainly using some mocked stuff, but that way your issue makes more sense! Ty!

@xlc
Copy link
Contributor

xlc commented Feb 16, 2023

FYI this is how we plan to write e2e xcm tests with Chopsticks https://github.com/AcalaNetwork/e2e-tests/blob/master/tests/karura-statemine/transfer-asset.test.ts

It not only use real runtime but also mainnet state

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants