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 CI test that checks an SNS can be launched using dfx nns / dfx sns #131

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

aterga
Copy link
Contributor

@aterga aterga commented Jul 12, 2024

No description provided.

@@ -53,6 +53,8 @@ jobs:
if: matrix.extension == 'sns'
- name: run test
run: timeout 2400 e2e/bats/bin/bats extensions/${{ matrix.extension }}/e2e/tests/*.bash
- name: run sns tests
run: timeout 2400 e2e/launch-simple-sns.sh

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@aterga aterga Jul 15, 2024

Choose a reason for hiding this comment

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

Thanks for the pointer. I was following the pattern I found in the CI config file. I'll also consult with the SDK team to find out their view on how to best add this script to the CI.

dfx identity use ident-1
PRINCIPAL_ID=$(dfx identity get-principal)

# Hack

Choose a reason for hiding this comment

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

Can you say more about why this hack is needed?

sleep 15s

# Top-up the SNS-W canister
dfx ledger fabricate-cycles --canister qaa6y-5yaaa-aaaaa-aaafa-cai --t 2345

Choose a reason for hiding this comment

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

How about using variables for the canister IDs? Also below.


dfx canister call "rrkah-fqaaa-aaaaa-aaaaq-cai" update_neuron '(
record {
id = opt record { id = '${NEURON_ID}' : nat64 };

Choose a reason for hiding this comment

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

I was super confused about why the variable expansion works with the single quotes. But then I realized you actually end the single quote string, concatenate the variable and then open a new string. Is that intentional or did it work by accident?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was intentional, but I'm no Bash expert — maybe there's a better way.

auto_stake_maturity = opt true;
aging_since_timestamp_seconds = 456 : nat64;
hot_keys = vec {};
account = blob "3\8fZ\9fn\af]\a9\17\be\ea\14yA\f3\b3\00\16\af[\ae\1cq\c0\a0\dd\1d?\d8\e7\a96";

Choose a reason for hiding this comment

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

Where does this blob come from?

cargo run --bin sns propose --neuron-id "${NEURON_ID}" sns_init.yaml

# Check that the CreateServiceNervousSystem propsoal was executed
PROPOSAL_DATA=$(dfx canister \

Choose a reason for hiding this comment

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

NCR: shellcheck would require double quotes around the $() so I guess this repo doesn't run a linter on the shell scripts?
Might be worth doing.

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.

2 participants