-
Notifications
You must be signed in to change notification settings - Fork 325
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(nns): Add a test for NNS proposals being adopted in the golden state #3461
base: arshavir/add-nns-governance-test-function-adopt_proposal
Are you sure you want to change the base?
test(nns): Add a test for NNS proposals being adopted in the golden state #3461
Conversation
a577397
to
48cef74
Compare
true, | ||
); | ||
|
||
// Step 3: Verify result(s): In a short while, the canister should be running the new code. |
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 would say that this is part of setting up the world (step 1). At this point, we are not yet verifying the code under test. (We are merely installing adopt_proposal so that we can run the code under test, namely, proposal execution, specifically for network economics.)
// Phase I. Upgrade NNS Governance to a test-only version (using a super powerful neuron) that | ||
// allows adopting any proposal by calling adopt_proposal. |
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.
// Phase I. Upgrade NNS Governance to a test-only version (using a super powerful neuron) that | |
// allows adopting any proposal by calling adopt_proposal. | |
// Step 1.2: Upgrade NNS Governance to a test-only version, which | |
// has adopt_proposal method. |
adopt_proposal(&state_machine, proposal_id).unwrap(); | ||
|
||
nns_wait_for_proposal_execution(&state_machine, proposal_id.id); |
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.
THIS is where the code under test gets executed.
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.
Well, you're not wrong.
But from another perspective, this is not a test for adopt_proposal
(that's sufficiently tested using unit tests).
The point of this test is, as I tried to explain in the PR description, to enable humans to answer the question:
- Is a given proposal submitted in the system from which the golden state snapshot was taken going to be executed successfully, assuming the NNS community adopts it?
- Is the proposal going to have the expected / desired effect?
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'll also explain this in a doc comment for this test.
69a4ecf
to
fa409b3
Compare
This PR adds a new target
//rs/nns/integration_tests:test_proposal_with_golden_nns_state
that allows testing the effect of a proposal being adopted in a system that has the golden state installed. While this target is designed for manual experiments, it is covered by a nightly test to avoid bit rot.< Previous PR |