Skip to content

test(sns): Porting sns-testing to the ICP mono repo, Part III#4705

Merged
aterga merged 23 commits intodfinity:masterfrom
serokell:serokell/sns-testing
Apr 17, 2025
Merged

test(sns): Porting sns-testing to the ICP mono repo, Part III#4705
aterga merged 23 commits intodfinity:masterfrom
serokell:serokell/sns-testing

Conversation

@aterga
Copy link
Contributor

@aterga aterga commented Apr 8, 2025

This is the third PR for implementing the next-gen sns-testing tool.

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.

< Previous PR |

@github-actions github-actions bot added the test label Apr 8, 2025
@aterga aterga marked this pull request as ready for review April 8, 2025 07:14
@aterga aterga requested a review from a team as a code owner April 8, 2025 07:14
rvem and others added 12 commits April 14, 2025 11:22
…anisters'

'is_canister_stopped' is currently used by PocketIc and ic-agent
implementations. However, the 'CallCanisters' trait requires
implementing this function. As a result, some trait implementations have
dummy implementation for this method which panics in runtime.

To avoid runtime panic, this method is extracted into a dedicated
'CallCanistersWithStoppedCanisterError' trait that inherits
'CallCanisters'. This trait is only implemented for PocketIc and ic-agent's.
An attempt to use 'is_canister_stopped_error' for other implementation
will cause compilation error instead of runtime panic.
Currently the ID of the NNS neuron that is used to submit proposals is
hardcoded which is potentially error-prone.

To fix this, 'sns-testing-init' and 'sns-testing run-basic scenario'
were made to consider neuron ID instead of using the hardcoded ID from
a separate crate.
Co-authored-by: Arshavir Ter-Gabrielyan <arshavir.ter.gabrielyan@dfinity.org>
Co-authored-by: Arshavir Ter-Gabrielyan <arshavir.ter.gabrielyan@dfinity.org>
Currently, IC network HTTP endpoint port launched by 'sns-testing-init'
is hardcoded to 8080.

This commit adds an additional command line option to 'sns-testing-init'
binary to make the port configurable.
'run-basic-scenario' subcommand is updated to take the WASM module and
Candid argument used for the canister upgrade as arguments instead of
hardcoding them. This allows users to run this "basic scenario" on
arbitrary canisters.
@rvem rvem force-pushed the serokell/sns-testing branch from e034084 to 9e424e5 Compare April 14, 2025 09:22
rvem added 5 commits April 14, 2025 11:40
Currently, README requires running binaries using 'bazel run' which
bloats usage instructions. Additionally, in the future, we'd like to
distribute all these binaries without 'bazel'.

This commit adds a bash script that builds all required binaries using
'bazel', copies them to the local directory and updates PATH.
README now implies the usage of this script to populate PATH and
explains how to use binaries without 'bazel run' wrapper (for all
binaries except 'sns-testing-init').
Currently, 'sns-testing-init' requires specifying the path to the
PocketIC directory explicitly. This introduces the necessity to clean up
the directory before re-running this binary (if the same value for the
option is used).

This commit makes '--state-dir' argument optional. If it's not provided,
a new temporary directory will be created. This directory will remain
even after 'pocket-ic-server' process has finished. This temporary
directory will be cleaned up on the next system reboot.
@aterga aterga added this pull request to the merge queue Apr 17, 2025
github-merge-queue bot pushed a commit that referenced this pull request Apr 17, 2025
This is a preliminary PR for discussing the changes that will be ported
to #4697

Context: Serokell sns-testing milestone III

---------

Co-authored-by: Roman Melnikov <roman.melnikov@serokell.io>
Co-authored-by: Roman Melnikov <rvembox@gmail.com>
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 17, 2025
@aterga aterga added this pull request to the merge queue Apr 17, 2025
Merged via the queue into dfinity:master with commit 34e135e Apr 17, 2025
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants