-
Notifications
You must be signed in to change notification settings - Fork 767
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 zombienet-sdk test to parachain-template #5342
Conversation
Great news! I see that the network config is defined inside the smoke test, so it doesn't really test that the I was actually working on a CI workflow in the separate template repo based on the old Do you think this |
Oh and one more - do you think it would make sense to add a similar smoke test for the other two templates (only asserting the state of the relaychains)? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be great if you also check the run instructions in the README to be simple and correct.
I was thinking of the same, and initially though it is not needed as you would usually run them with a single node, but better add it everywhere. for the for |
Hi @rzadp / @kianenigma, thanks for the feedback! I will track these changes here:
Thx! |
//! This test is setup to run with the `native` provider and needs these binaries in your PATH | ||
//! `polkadot`, `polkadot-prepare-worker`, `polkadot-execute-worker`, `parachain-template-node`. | ||
//! You can follow these steps to compile and export the binaries: | ||
//! `cargo build --release -features fast-runtime --bin polkadot --bin polkadot-execute-worker --bin | ||
//! polkadot-prepare-worker` | ||
//! `cargo build --package parachain-template-node --release` | ||
//! `export PATH=<path-to-polkadot-sdk-repo>/target/release:$PATH | ||
//! | ||
//! The you can run the test with | ||
//! `cargo test -p parachain-template-zombienet` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if someone is running cargo test
in the repo, it will fail. Then they will be confused and at some point maybe find these docs. TBH, this is not any nice experience. Generally for running these tests it is not a nice experience.
I still don't get the need for writing them in Rust. This just makes it even more complicated than it already is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @bkchr, thanks for the feedback. I'm agree that the dx needs to improve and isn't in the final shape. Wdyt about make this test feature gated and even if you pass the feature run some sanity check to ensure the preconditions (e.g the binaries) are availables and if not print a nice guide about the requirements?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i agree, it should probably be something like cargo test --features zombienet
Not sure if i have an opinion of rust / not rust.
it is nice that you dont need anything but rust to run zombienet in this situation.
rust is a bit more complicated, but that should not be limiting factor for developers who want to do this anyway.
//! `cargo build --release -features fast-runtime --bin polkadot --bin polkadot-execute-worker --bin | ||
//! polkadot-prepare-worker` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
//! `cargo build --release -features fast-runtime --bin polkadot --bin polkadot-execute-worker --bin | |
//! polkadot-prepare-worker` | |
//! `cargo install --git https://github.com/paritytech/polkadot-sdk/ --tag polkadot-stable2407 | |
//! polkadot polkadot-execute-worker polkadot-prepare-worker` |
Ideally we could automatically replace the tag here as the template updates
//! `cargo build --release -features fast-runtime --bin polkadot --bin polkadot-execute-worker --bin | ||
//! polkadot-prepare-worker` | ||
//! `cargo build --package parachain-template-node --release` | ||
//! `export PATH=<path-to-polkadot-sdk-repo>/target/release:$PATH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
//! `export PATH=<path-to-polkadot-sdk-repo>/target/release:$PATH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You still need to have <path-to-polkadot-sdk-repo>/target/release
in your PATH in order to run parachain-template-node
, minimal-template-node
, etc.
Co-authored-by: Bastian Köcher <git@kchr.de>
templates/zombienet/Cargo.toml
Outdated
zombienet-sdk = "0.2.6" | ||
|
||
[features] | ||
zombienet = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this have a separate feature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is to hide this integration test behind a feature, since require some extra artifacts and steps and we don't want to mess with people running cargo test
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But if you run cargo test
in a template, for example ./templates/parachain
, this crate is not part of your working tree and is not tested anyways??
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
The CI pipeline was cancelled due to failure one of the required jobs. |
ping @kianenigma / @shawntabrizi can we merge this one? NOTE: I need to fix the sdk in order to work with the |
zombienet-sdk = "0.2.8" | ||
|
||
[features] | ||
zombienet = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, this is not needed, as this crate is no longer part of templates/parachain
. If you run cargo test
in templates/parachain
, this crate is not called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback @kianenigma! The idea behind the feature flag is to prevent failures in these tests for users that run cargo test --workspace
in the polkadot-sdk repo, since this tests need some extra steps (build the binaries) in order to run. So, I think we can keep the feature and set in our CI to ensure block production for the templates.
Thx!
//! The you can run the test with | ||
//! `cargo test -p template-zombienet-tests` | ||
|
||
#[cfg(feature = "zombienet")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#[cfg(feature = "zombienet")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The feature needs to be removed, otherwise looks good.
Hi @kianenigma, just re-iterating on this. The feature flag is to prevent failures in these tests for users that run cargo test --workspace in the Thx! |
Add new
CI
machinery to smoke test theparachain-template-node
using zombienet-sdk.Thx!