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

[TEST] 639 CFund Tests #640

Merged
merged 10 commits into from
Jun 12, 2020
Merged

Conversation

proletesseract
Copy link
Member

@proletesseract proletesseract commented Nov 23, 2019

Related to Issue #639

Adding the foundations for a comprehensive test suite for the NavCoin DAO / CFund.

I've removed the "Work in Progress" label on this PR. Instead of waiting for every test to be written i think its better to merge what is currently there and then slowly add tests otherwise we could be waiting forever until every possible scenario is covered.

It's important to understand that what is in this PR is just some simple building blocks, once the basics are covered we can use these building blocks to construct ever increasingly complex test scenarios and perhaps eventually even automate/randomise test scenarios to see if anything breaks after sequences of events which we might not think to test.

I've merged in the latest master and all the tests i've written so far are passing. Can I please get some reviews and comments or approvals.

The current test scenarios that are covered can be found in the test plan but are summarised below;

Scenarios

Scenario 001

ID CFUND_003
Reporter @proletesseract
Author @proletesseract
Satus Done
Description It should create a proposal and let it expire
File ./001-proposal-expired.py
  1. Given I have created a proposal
  2. When The proposal is not voted on
  3. Then the proposal should expire

Test Steps

  • Activate CFund
  • Donate to the CFund
  • Create a proposal
  • Do not cast any votes
  • End the full round of voting cycles
  • Check proposal expired

Scenario 002

ID CFUND_002
Reporter @proletesseract
Author @proletesseract
Satus Done
Description It should create a proposal and the network should reject the proposal
File ./002-proposal-rejected.py
  1. Given I have created a proposal
  2. When The proposal receives the consensus of no votes
  3. Then the proposal should be rejected

Test Steps

  • Activate CFund
  • Donate to the CFund
  • Create a proposal
  • Votes no on the proposal
  • End the full round of voting cycles
  • Check proposal is rejected

Scenario 003

ID CFUND_003
Reporter @proletesseract
Author @proletesseract
Satus Done
Description It should create a proposal and the network should accept the proposal
File ./003-proposal-accepted.py
  1. Given I have created a proposal
  2. When The proposal receives the consensus of yes votes
  3. Then the proposal should be accepted

Test Steps

  • Activate CFund
  • Donate to the CFund
  • Create a proposal
  • Votes yes on the proposal
  • End the full round of voting cycles
  • Check proposal is rejected

Scenario 004

ID CFUND_004
Reporter @proletesseract
Author @proletesseract
Satus Done
Description It should fail to create a payment request for an expired proposal
File ./004-proposal-expired-preq.py
  1. Given I have an expired proposal
  2. When A payment request is made
  3. Then the payment request should not exist

Test Steps

  • Activate CFund
  • Donate to the CFund
  • Create a proposal
  • Do not cast any votes
  • End the full round of voting cycles
  • Submit a payment request
  • Check payment request does not exist

Scenario 005

ID CFUND_005
Reporter @proletesseract
Author @proletesseract
Satus Done
Description It should fail to create a payment request for a rejected proposal
File ./005-proposal-expired-preq.py
  1. Given I have a rejected proposal
  2. When A payment request is made
  3. Then the payment request should not exist

Test Steps

  • Activate CFund
  • Donate to the CFund
  • Create a proposal
  • Votes no on the proposal
  • End the full round of voting cycles
  • Submit a payment request
  • Check payment request does not exist

Scenario 006

ID CFUND_006
Reporter @proletesseract
Author @proletesseract
Satus Done
Description It should create a payment request for an accepted proposal
File ./006-proposal-accepted-preq.py
  1. Given I have an accepted proposal
  2. When A payment request is made
  3. Then the payment request should exist

Test Steps

  • Activate CFund
  • Donate to the CFund
  • Create a proposal
  • Votes yes on the proposal
  • End the full round of voting cycles
  • Submit a payment request
  • Check payment request exists

@proletesseract proletesseract changed the title 639 cfund tests [WIP] 639 CFund Tests Nov 23, 2019
@navbuilder
Copy link

A new build of 1cb6165 has completed succesfully!
Binaries available at https://build.nav.community/binaries/639-cfund-tests

@navbuilder
Copy link

A new build of 8af9dfa has completed succesfully!
Binaries available at https://build.nav.community/binaries/639-cfund-tests

@navbuilder
Copy link

A new build of fb5d08d has completed succesfully!
Binaries available at https://build.nav.community/binaries/639-cfund-tests

@proletesseract proletesseract changed the title [WIP] 639 CFund Tests 639 CFund Tests Jan 25, 2020
@navbuilder
Copy link

A new build of 87a744a has completed succesfully!
Binaries available at https://build.nav.community/binaries/639-cfund-tests

@proletesseract
Copy link
Member Author

proletesseract commented Jan 26, 2020

IDK why the cfunddb-statehash.py is failing to sync the nodes back together in travis. Works fine for me locally (but im using OSX) and i haven't changed that test. Ill keep re-running it.

@chasingkirkjufell
Copy link
Contributor

Ran all the tests and they all passed.

@mxaddict
Copy link
Contributor

mxaddict commented Feb 25, 2020 via email

@chasingkirkjufell
Copy link
Contributor

chasingkirkjufell commented Feb 25, 2020

What's the tl;dr on this PR?

On Tue, Feb 25, 2020, 23:06 chasingkirkjufell @.***> wrote: Ran all the tests and they all passed. — You are receiving this because your review was requested. Reply to this email directly, view it on GitHub <#640?email_source=notifications&email_token=AAIDAKONWFK4YVABMSJNCTLREUXWLA5CNFSM4JQY5LYKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEM4JYNA#issuecomment-590912564>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIDAKIO636BS43NGFFY3WTREUXWLANCNFSM4JQY5LYA .

Functional testing of the cfund and potentially DAO. Things like creating a proposal and vote no and assert that the proposal is rejected.

@mxaddict mxaddict changed the title 639 CFund Tests [TEST] 639 CFund Tests Jun 12, 2020
@mxaddict
Copy link
Contributor

IDK why the cfunddb-statehash.py is failing to sync the nodes back together in travis. Works fine for me locally (but im using OSX) and i haven't changed that test. Ill keep re-running it.

I've fixed this issue here: #715

@mxaddict
Copy link
Contributor

@proletesseract if you have a few minutes, can you check out the conflict for qa/rpc-tests/dao/test-plan.md ?

I think this PR is ready to merge

@navbuilder
Copy link

A new build of 37d6ca1 has completed succesfully!
Binaries available at https://build.nav.community/binaries/639-cfund-tests

@navbuilder
Copy link

A new build of ededb0a has completed succesfully!
Binaries available at https://build.nav.community/binaries/639-cfund-tests

@aguycalled aguycalled merged commit 673a656 into navcoin:master Jun 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants