Repository navigation
test(sns): Porting sns-testing to the ICP mono repo, Part II - #4548
Merged
Merged
Conversation
We want to be able to reuse some of these helpers outside of PocketIC environment using `ic-agent` as a backend. So we're porting some of the helpers for NNS/SNS to use 'ic_nervous_agent' instead of 'pocket_ic'. Note that at the moment these helpers still provide 'pocket_ic'-based interface and they will be abstracted out later.
We want to reuse some of the helpers from 'pocket_ic_helpers' module in non PocketIC-specific environment. To achieve this, these helpers were abtracted out to use generic 'CallCanisters' interface to interact with the network. 'pocket_ic_helpers' interface remains the same and uses 'nervous_agent_helpers' implementation for those helpers that we re-implemented.
We want to be able SNS-specific parts of sns-testing scenario on the network provided either via PocketIC or via 'ic-agent' clients. The following parts of sns-testing scenario were reimplemented to use nervous-agent-based implementation: * NNS proposal creation and adoption to create the new SNS. * SNS swap completion. * SNS proposal creation and adoption to upgrade the test canister.
Currently the CLI from sns-testing runs the basic scenario using PocketIC API. However, we'd like to be able to run the scenario on artibrary network available via ic-agent-compatible HTTP endpoint. To achieve this, the CLI was split into two subcommands: * 'nns-init' This subcommand bootstraps the NNS on a fresh PocketIC instance using PocketIC API. * 'run-basic-scenario' This subcommand runs the basic scenario (create and adopt the new SNS via NNS proposal, complete SNS swap, upgrade SNS-controlled canister via SNS proposal) on a network provided by HTTP endpoint using 'ic-agent' as a backend.
…ning the basic scenario If the network setup is invalid or the target canister doesn't have the correct state (e.g. doesn't have the NNS Root canister as a controller), the scenario may fail during the execution throwing potentially confusing errors from NNS/SNS canisters and leaving the SNS in 'failed' state. Moreover, these errors may not be thrown instantly and the user may have to wait before actually knowing that something is off. Add steps to validate the target IC network and the target test canister. Network validation checks the following: 1) All "backend" NNS canisters are installed. 2) The network has SNS subnet. 3) The SNS WASM canister has SNS canisters' WASM modules. Test canister validation checks the following: 1) Canister was created and installed. 2) The NNS Root canister is controller of the canister.
…ore running the basic scenario
…ore running the basic scenario
…ore running the basic scenario
…ore running the basic scenario
Using user-provided identity as ICP treasury is error-prone since the user may accidentally provide wrong identity name as an argument. Use hardcoded identity instead. Since it's deterministically generated, it's guaranteed to always be the same over 'sns-testing' invocations.
PocketIC now exposes a dedicated method to determine whether the instance is running in 'auto_progress' mode.
Contributor
There was a problem hiding this comment.
If this pull request affects the behavior of any canister owned by
the Governance team, remember to update the corresponding
unreleased_changes.md file(s).
To acknowldge this reminder (and unblock the PR), dismiss this
code review by going to the bottom of the pull request page, and
supply one of the following reasons:
-
Done.
-
No canister behavior changes.
aterga
dismissed
github-actions[bot]’s stale review
March 27, 2025 09:01
No canister behavior changes.
aterga
enabled auto-merge
March 27, 2025 09:01
aterga
enabled auto-merge
March 27, 2025 09:04
max-dfinity
reviewed
Mar 27, 2025
max-dfinity
reviewed
Mar 27, 2025
max-dfinity
reviewed
Mar 27, 2025
max-dfinity
reviewed
Mar 27, 2025
max-dfinity
reviewed
Mar 27, 2025
max-dfinity
reviewed
Mar 27, 2025
max-dfinity
reviewed
Mar 27, 2025
max-dfinity
reviewed
Mar 27, 2025
max-dfinity
reviewed
Mar 27, 2025
max-dfinity
reviewed
Mar 27, 2025
max-dfinity
reviewed
Mar 27, 2025
max-dfinity
reviewed
Mar 27, 2025
max-dfinity
approved these changes
Mar 31, 2025
sasa-tomic
pushed a commit
that referenced
this pull request
Apr 7, 2025
This is the second PR for implementing 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: #4067 < [Previous PR](#3979) | --------- Co-authored-by: Roman Melnikov <[email protected]>
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Apr 17, 2025
This is the third PR for implementing the next-gen [sns-testing](https://github.com/dfinity/sns-testing) tool. 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. < [Previous PR](#4548) | --------- Co-authored-by: Roman Melnikov <[email protected]> Co-authored-by: Roman Melnikov <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the second PR for implementing 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. Please refer to the reviews here: #4067
< Previous PR | Next PR >