Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic XCM emulator tests #114

Merged

Conversation

acatangiu
Copy link
Contributor

This PR adds XCM emulator tests for Relay chains and Asset Hub System parachains.

It adds them under new integration-tests/emulated/ dir which lives at the root of the repo and doesn't pollute the prod networks code/crates/etc in any way. As you can see from the diff, no other files outside integration-tests are touched by this PR (except workspace Cargo.toml and Cargo.lock).

Tests added by this PR are rather old/limited, but I will update them when we bump polkadot-sdk crates deps to v1.4 or v1.5 release. This will bring in more refined tests for existing scenarios and many new tests for new scenarios such as complex asset-transfers and bridging - sending XCMs over bridge, and asset transfers between AHs on different relays using bridge.

Also after bumping repo to sdk v1.4 or v1.5 release, we can also drop 90% of integration-tests/emulated/common and get it from crates.io.

Fixes #103

authors.workspace = true
edition.workspace = true
license = "Apache-2.0"
description = "Common resources for integration testing with xcm-emulator"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After bumping repo to sdk v1.4 or v1.5 release, we can drop 90% of the code in this module and get it from https://crates.io/crates/emulated-integration-tests-common/1.0.0

@NachoPal
Copy link
Contributor

NachoPal commented Dec 13, 2023

@acatangiu We are planing to add XCM emulator to its own repository. It is still WIP: https://github.com/paritytech/polkadot-integration-tests/tree/master

@acatangiu
Copy link
Contributor Author

@acatangiu We are planing to add XCM emulator to its own repository. It is still WIP: https://github.com/paritytech/polkadot-integration-tests/tree/master

Why would they be on a different repo? I mean I don't see any benefits, while seeing massive drawbacks. It's already hard enough to coordinate over polkadot-sdk and polkadot-fellows, why would we make it even harder?

@NachoPal
Copy link
Contributor

@acatangiu We are planing to add XCM emulator to its own repository. It is still WIP: https://github.com/paritytech/polkadot-integration-tests/tree/master

Why would they be on a different repo? I mean I don't see any benefits, while seeing massive drawbacks. It's already hard enough to coordinate over polkadot-sdk and polkadot-fellows, why would we make it even harder?

Let's continue the conversation here: #103 (comment)

@acatangiu
Copy link
Contributor Author

acatangiu commented Dec 18, 2023

@bkchr @ordian this needs another Rank 3 reviewer because it touches CI files.
(also please re-trigger the failed migration test as CI was API rate-limited when trying to set up test env)

@ordian
Copy link
Contributor

ordian commented Dec 18, 2023

I recall @rphmeier having issues with how those tests were written affecting async backing changes

Cargo.lock Outdated Show resolved Hide resolved
@acatangiu
Copy link
Contributor Author

I recall @rphmeier having issues with how those tests were written affecting async backing changes

I can't think of any issues with async backing - afaik the emulator doesn't build any blocks per-se - it emulates everything underneath the runtime using some dumb buffers - point being to test the runtime behavior, especially XCM message passing and execution.

These tests currently run on Rococo and Westend too, where I was under the impression async backing is already enabled. Or are you talking about some limitation on some yet unreleased async backing feature?

@joepetrowski
Copy link
Contributor

@acatangiu
Copy link
Contributor Author

@ordian @bkchr this is good to go

Copy link
Contributor

@ordian ordian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't looked at the tests closely, but since most of it is going to be removed after bump to 1.5 is merged as you say, don't want to block this PR.

@acatangiu
Copy link
Contributor Author

@joepetrowski bot is not counting your review after latest push, can you try to re-approve?

@acatangiu
Copy link
Contributor Author

/merge

@acatangiu
Copy link
Contributor Author

@bkchr @ggwpez who has merge button?

@bkchr
Copy link
Contributor

bkchr commented Jan 4, 2024

@fellowship-merge-bot
Copy link
Contributor

Enabled auto-merge in Pull Request

Available commands
  • /merge: Enables auto-merge for Pull Request
  • /merge cancel: Cancels auto-merge for Pull Request
  • /merge help: Shows this menu

For more information see the documentation

@fellowship-merge-bot fellowship-merge-bot bot enabled auto-merge (squash) January 4, 2024 13:35
@acatangiu
Copy link
Contributor Author

@acatangiu please be patient :P https://github.com/polkadot-fellows/runtimes/actions/runs/7410194917/job/20161942771

ah, nice, I thought bot is ignoring me since I'm not part of fellowship, but I was just being impatient 😛

@fellowship-merge-bot fellowship-merge-bot bot merged commit 4422084 into polkadot-fellows:main Jan 4, 2024
13 checks passed
@bkchr
Copy link
Contributor

bkchr commented Jan 4, 2024

Yeah, we had a lot of jobs running and github action has probably some upper number of parallel runners per project.

@ggwpez
Copy link
Member

ggwpez commented Jan 4, 2024

There are 4 failing tests here after a weight update: #129
I fixed two of them, but dont know about the other two.

Its also waiting for cumulus_pallet_dmp_queue::Event::ExecutedDownward, that event type got removed two months ago. So maybe updating to the new crates versions fixes this.

@ggwpez ggwpez mentioned this pull request Jan 4, 2024
9 tasks
@acatangiu
Copy link
Contributor Author

Its also waiting for cumulus_pallet_dmp_queue::Event::ExecutedDownward, that event type got removed two months ago. So maybe updating to the new crates versions fixes this.

Yes, it’s using old(er) polkadot-sdk crate versions (from v1.3.0 release). When we’ll bump deps, we’ll update tests too.

There are 4 failing tests here after a weight update: #129 I fixed two of them, but dont know about the other two.

I can look into it tomorrow.

@bkontur bkontur mentioned this pull request Jan 12, 2024
19 tasks
@acatangiu acatangiu deleted the add-xcm-emulator-tests branch July 1, 2024 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add xcm-emulator for (at least some) testing of relay and system parachains runtimes
7 participants