-
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
end2endtest refactoring #874
Conversation
56d9f19
to
d879b33
Compare
i want to make a couple of small improvements yet:
but i consider this ready for review already, feedback welcome |
notable things done until now in this PR:
|
12a3665
to
256fe4d
Compare
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.
Great job @altergui, the code looks quite neat.
I'd suggest some changes on the general structure.
-
Add the test implementations into one ore several subdirectories and packages, they might be group by type, i.e "voting_tests" "account_tests"
-
In the main package directory, you might have the interface definition and the cmd.
-
You might want to have a "shared" directory package, with the functions that are shared among tests. Be aware of avoiding cyclic imports.
645325a
to
e37b2c7
Compare
be71bf3
to
67a2622
Compare
a most notable change that i want to highlight is that now job_compose_test runs the tests concurrently, which led to uncovering a couple of bugs like #890 that i either worked around or fixed. previously we simply said "ok let's not do this concurrently". so the run time is halved to 4mins instead of the usual 8-12 minutes, which is simply GREAT. it takes roughly the same as job_go_test, which is also run concurrently. so now the whole CI takes 4 mins, instead of go_test taking 4 mins and compose_test taking ages |
for me this is ready to merge as-is: even though it could be improved (returns instead of Fatals, deduplicating code), it doesn't break anything and already brings a lot of value, so i believe it's better to merge it (also unblocking #873) and open a second iteration of refactoring in a new PR |
92c9a5a
to
d50e7df
Compare
d50e7df
to
66a586e
Compare
Just one conflict to resolve I think |
66a586e
to
37e5375
Compare
e2etest: refactor operations structure (VochainTest interface) * implement VochainTest interface to separate Setup, Run and Teardown * populate ops var (now a map[string]operation) in init() of each file * rename operations * anonvoting -> anonelection * tokentransactions -> tokentxs * vtest -> plaintextelection * new test encryptedelection * apiclient: add SecretUntilTheEnd support to apiclient.Vote() * New methods WaitUntilElectionKeys, ElectionKeys, prepareVoteEnvelope, prepareVotePackageBytes * ci: update tests_to_run * add e2etest_plaintextelection * add e2etest_encryptedelection * run new end2endtests concurrently * drop legacy vochaintests * fix: tokentxs WaitUntilNextBlock before checking resulting state
* add helper methods * helpers remove unnecessary code * main, add election base struct and remove code that already exists in helpers * update getFaucetPackage calls * use helper methods in plaintext test * remove unnecessary code * update generateProofs * update plaintextelection * update generateProofs for correctly support anonymous voting proofs * port anonelection to use helpers * port encryptedelection to use helpers * cleaning * main sort imports * wait longer in some places * improve approach in Setup with a flexible setupElection
05d0b26
to
4d3ef33
Compare
plaintextelection
instead ofvtest