-
Notifications
You must be signed in to change notification settings - Fork 17
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
Extend end-to-end tests to cover more voting scenarios #863
Comments
i'm doing "Secret Until The End Elections" and @mariajdab will start with "Max Vote Overwrite" today |
We should create a modular and flexible interface that all test implementations must follow. This will allow the main() function to call the interface methods of the selected test without having to modify the core code for each new test case. Goals
Interfacetype VochainTest interface {
Setup(api *apiclient.Client, config *Config) error
Run() (duration time.Time, err error)
Teardown() error
} The VochainTest interface should include three methods: Setup, Run, and Teardown. The Setup method initializes the test environment and performs any prepare operation (such as building the Census), the Run method executes the test scenario, and the Teardown method cleans up any resources created during the test. ExampleYou can then update the main function to call the interface methods of the selected test: func main() {
// ...
// Parse flags, configure logger, etc.
// ...
var test VochainTest
found := false
for _, op := range ops {
if op.name == c.operation {
test = op.test
found = true
}
}
if !found {
log.Fatal("no valid operation mode specified")
}
api, err := createAPI(c.host, c.accountKeys[0])
if err != nil {
log.Fatal(err)
}
err = test.Setup(api, &c)
if err != nil {
log.Fatal(err)
}
duration, err := test.Run()
if err != nil {
log.Fatal(err)
}
log.Infow("test finished", "duration", duration)
} Test definition: var ops = []struct {
name string
description string
example string
test VochainTest
}{
{
name: "merkleTreeVoting",
description: "Perform a Merkle Tree Voting test",
example: "vocdoni -operation merkleTreeVoting",
test: &MerkleTreeVotingTest{},
},
// Add more tests here
} This is just a proposal, feel free to design your own structure, but please explain the rationale behind your decisions. |
How is this going? can you update on the status? any blockers? |
Please, @mariajdab @altergui mark as done (checkbox) once a test is merged into master |
Regarding the Ballot Protocol test. How far did the implementation go? How many of the following types of votings are being tested? https://blog.aragon.org/vocdoni-ballot-protocol/ |
I think in the end2end test for ballot we are checking only the Quadratic Voting but using the default value of 1, so it could be updated to use 2 as |
With costExponent=1 this is not quadratic voting. Quadratic means exponent=2 The ballot protocol test proposed was meant to check that the different types of votes supported by the ballot protocol are correctly implemented. At least the following should be checked:
To understand how these types of votes work, you can search them on Google (all are well known) and also check these documents: https://developer.vocdoni.io/protocol/ballot https://blog.aragon.org/vocdoni-ballot-protocol/ https://hackmd.io/Sd08WpUPSVu6DEK9hSA-6Q If you need any clarification, do not hesitate to ask. |
epic work, hurray! congrats @mariajdab |
We need to extend the end-to-end tests with a new voting test named something like "test voting protocol". This test should cover various voting scenarios and capabilities of the Vocdoni protocol to ensure the correct behavior and stability of the system.
The test should include the following scenarios and verifications:
Secret Until The End Elections: the apiclient Vote method would transparently encrypt the vote if the election is secretUntilTheEnd (encrypt elections support for end2end test #846)
Max Vote Overwrite: Verify that the same voter can send up to N votes, and each new vote should override the previous one. This will ensure the maxVoteOverwrite feature works as intended.
Max Census Size Restriction: Test the behavior when creating an election with a maxCensusSize smaller than the actual census size. Ensure that no additional votes can be cast once the limit is reached, thus validating the maxCensusSize restriction feature.
Ballot Protocol: Test different ballotProtocol configurations and validate that the final results are computed correctly based on the configuration parameters (uniqueValues, costFromWeight, maxCount, maxValue, maxTotalCost, costExponent). This will ensure the versatility and correctness of the ballot protocol (see https://hackmd.io/Sd08WpUPSVu6DEK9hSA-6Q)
Election Status: Test and verify the transitions of an election (READY, PAUSED, RESULTS, etc.) to ensure that only allowed transitions work correctly. This will validate the robustness of the election status management.
Un-interruptible Enforcement: Check if the interruptible flag works as expected by ensuring that elections with this flag set to false cannot be interrupted. This will validate the proper enforcement of the un-interruptible feature.
Dynamic Census: Test the dynamic census flag and feature by verifying that it works as expected in various scenarios. This will ensure the correct functionality of the dynamic census feature.
CSP Election: this was implemented in vochaintest as csptest. migrate it to end2endtest
The text was updated successfully, but these errors were encountered: