-
Notifications
You must be signed in to change notification settings - Fork 337
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
test(sns): Porting sns-testing to the ICP mono repo - old #3654
Conversation
4214bb7
to
018ddc3
Compare
This PR looks good to me. Note that I cannot approve as I've opened the PR. @max-dfinity, could you PTAL? |
bb6af18
to
d759d6e
Compare
02fd5b5
to
707491a
Compare
aac0e46
to
66b9a9e
Compare
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.
Approving based on Arshavir's review of external contribution (he opened PR for external contributor, so cannot click "Approve")
Head branch was pushed to by a user without write access
Canister installation may fail due to insufficient cycles, so add cycles before installing the canister in 'install_canister_with_controllers'. The same is already done in 'install_canister_on_subnet'.
Problem: NNS dapp needs ICP ledger index and Cycles minting canisters to be deployed. Currently 'install_nns_canisters' doesn't install them. Solution: Add 'install_nns_suite' helper that optionally installs ICP ledger index and Cycles minting canisters. The existing 'install_nns_canisters' reuses 'install_nns_suite' but doesn't install them.
Init the new sns-testing project. Currently, this crate provides CLI to bootstrap NNS on the provided PocketIC instance.
Co-authored-by: Arshavir Ter-Gabrielyan <[email protected]>
1) Add a simple test canister that will be decentralized as a part of newly created SNS 2) Add helpers to install this canister and run it as the new SNS 3) Complete the SNS swap to finalize SNS adoption
Add helpers to upgrade the test canister. Currently, the helper will reuse the same WASM module, but it's possible to provide the new state value as a 'post_upgrade' hook argument. Test scenario as well as CLI now perform canister upgrade. The former also allows to see the SNS voting procedure in the NNS dapp web UI.
Problem: Currently, helpers from 'pocket_ic_helpers' module use 'advance_time' pocket-ic method to artificially advance time in order to wait for certain events to happen. However, using 'advance_time' in live mode breaks agent certificates checking since pocket-ic time becomes larger than the real time. Solution: 1) When pocket-ic is running in live mode, run 'std::thread::sleep()' instead of 'advance_time()'. 2) Avoid waiting two days for SNS swap to start in live mode. 3) Allow to use the test version of NNS Governance canister which is capable of starting SNS swap immediately after SNS proposal adoption.
Problem: We want to be able to run pocket-ic in live mode. However, this is not viable with non-test version of NNS Governance canister because it postpones the SNS swap start. Solution: Use test version of NNS Governance canister. Ensure that swap start_time is 'None' to start the swap immediately after SNS creation proposal adoption.
Check that PocketIC network has all required subnets and install NNS-related canisters (core and frontend) only when they're missing. At this point, we do not check that canisters were correctly initialized, so this check might not be sufficient to run the scenario on arbitrary network.
'get_controllers' method panics if the target canister doesn't exist
6feb1ea
to
214c220
Compare
This can't be merged right now due to CDN access issues that are currently blocking. We'll merge a mirror on this PR instead: #3979 |
This PR implements the next-gen [sns-testing](https://github.com/dfinity/sns-testing) tool. It can now be written in Rust and continuously tested against the latest SNS features. At the core of this tool lies the [PocketIC framework](https://crates.io/crates/pocket-ic/6.0.0), the testing framework capable of creating a fully deterministic environment for testing complex ICP dapp scenarios. This PR is authored by Serokell and reviewed by the DFINITY Foundation. Please refer to the reviews here: #3654 --------- Co-authored-by: Roman Melnikov <[email protected]> Co-authored-by: Roman Melnikov <[email protected]>
This PR implements the next-gen [sns-testing](https://github.com/dfinity/sns-testing) tool. It can now be written in Rust and continuously tested against the latest SNS features. At the core of this tool lies the [PocketIC framework](https://crates.io/crates/pocket-ic/6.0.0), the testing framework capable of creating a fully deterministic environment for testing complex ICP dapp scenarios. This PR is authored by Serokell and reviewed by the DFINITY Foundation. Please refer to the reviews here: #3654 --------- Co-authored-by: Roman Melnikov <[email protected]> Co-authored-by: Roman Melnikov <[email protected]>
This PR implements the next-gen sns-testing tool. It can now be written in Rust and continuously tested against the latest SNS features.
At the core of this tool lies the PocketIC framework, the testing framework capable of creating a fully deterministic environment for testing complex ICP dapp scenarios.
This PR is authored by Serokell and reviewed by the DFINITY Foundation.