WIP: Contribution contracts tests #159
Closed
haythem96 wants to merge 20 commits from
tests/contracts-contribution into master
pull from: tests/contracts-contribution
merge into: :master
:master
:new-final-deploy
:new-final-deploy-2
:reimbursement-export
:staging
:legacy
:addresses/rsk-testnet-raucao-1
:ipfs-defaults
:deletemewhendone
:feature/184-improve_withdrawal
:tests/contracts-contribution
:tests/contracts-kit
:kit/add-vault-app
:feature/ipfs_hash_in_add_response
:chore/bootstrap-on-travis
:chore/remove-direct-aragon-cli-dependency
:chore/update-dependencies-1
:fix/ipfs-config
:apm-hack
:wtf/package-lock
:feature/contributor-balance
:feature/constructor-options
Labels
Clear labels
good first issue
ipfs
rsk
scaling
bug
dev environment
docs
duplicate
enhancement
feature
idea
invalid
kredits-1
kredits-2
kredits-3
question
security
ui/ux
wontfix
Good for newcomers
Something is not working
Config, builds, CI, deployment, etc.
Documentation
This issue or pull request already exists
Improving existing functionality
New functionality
Something to consider
Not a bug
Small contribution
Medium contribution
Large contribution
Looking for an answer
release
major
release
minor
release
patch
All your base are belong to us
User interface, process design, etc.
This won't be fixed
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: kredits/contracts#159
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Related to #103
this one revert for some reasons
Looks like the expectation wasn't described here (
it("does x")). It also looks like there are 3 different expectations in one block here.I think you can also add expectation descriptions as the last argument to
assert(), in case you really want to assert multiple things in oneitblock.Reverts unexpectedly? And in which context/scenario?
in the scenario of claiming an added contribution
most of those multiple assert check for the same thing, that the contribution is added.. XD
How would that work? You can only claim confirmed contributions.
They very line I commented on asserts that the contributorId is correct, not that the contribution itself was added.
ahhhh yup okay, missed this
require(block.number >= c.confirmedAtBlock, 'NOT_CLAIMABLE');thanks!yeah true, honestly don't know if that all those asserts are necessary... maybe just for more code coverage
In this case it's only important that you describe what you mean to test exactly. Currently, there's no description of what is being tested in this block.
this should fix the claim tests, no @skddc @bumi ?
idk if this test is really necessary as if a contribution is claimed, so theoretically it is impossible to veto because of block number @bumi
can't figure out why this one is not working, idk what I'm missing there! @bumi @skddc
blocks get minted and the veto period end right away... @bumi @skddc
@@ -0,0 +87,4 @@appsId[3] = namehash("kredits-token");//get new app instance from DAOlet receipt = await dao.newAppInstance(getBlockNumbershould actually return a promise as well, so this entire function is superfluous. We're using it with a promise e.g. here: https://github.com/67P/kredits-web/blob/master/app/services/kredits.js#L150@@ -0,0 +87,4 @@appsId[3] = namehash("kredits-token");//get new app instance from DAOlet receipt = await dao.newAppInstance(it return also there a promise, no ?
@@ -0,0 +87,4 @@appsId[3] = namehash("kredits-token");//get new app instance from DAOlet receipt = await dao.newAppInstance(The function you added is just wrapping the normal callback in a promise. Wherever it's called you can just use the original function with a promise.
@@ -0,0 +87,4 @@appsId[3] = namehash("kredits-token");//get new app instance from DAOlet receipt = await dao.newAppInstance(I updated it, the thing is blocks get mined instantly so veto period end...
Yes, the first 10 are confirmed immediately iirc.
As an update:
@@ -18,0 +22,4 @@- TASK=test:contributor- TASK=test:contribution- TASK=test:proposalThis should be the same as the test script itself, because
&&is supposed to exit with 1, if any of the commands on the way exit with 1.@@ -18,0 +22,4 @@- TASK=test:contributor- TASK=test:contribution- TASK=test:proposalyeah true, I changed that also to
It is the same also, but
> /dev/null &to not show the output and usingTASKfor better visualization I think...But the thing is there is an error in Contribution tests, but it doesn't exit with 1!
@@ -18,0 +22,4 @@- TASK=test:contributor- TASK=test:contribution- TASK=test:proposalI don't see how the env vars make it clearer. I think it's actually less understandable that way. In fact, I wouldn't even know off the top of my head what happens when you assign the same env variable twice.
Yes, that's the thing that needs to be fixed I think. Not how the tests are run. The test task should just be
npm testand nothing else, in my opinion.@@ -18,0 +22,4 @@- TASK=test:contributor- TASK=test:contribution- TASK=test:proposalWhat I meant by the env vars make it clearer, in Travis u don't need to look at the whole log in case a test fail...

@@ -45,3 +45,4 @@"@aragon/kits-base": "^1.0.0","@aragon/os": "^4.2.0","@aragon/test-helpers": "^2.0.0","async-each-series": "^1.1.0",Adding the test-helpers package fixed #163
@@ -18,0 +22,4 @@- TASK=test:contributor- TASK=test:contribution- TASK=test:proposalOh, I see. The feature you're looking for is the build matrix:
https://docs.travis-ci.com/user/customizing-the-build/#naming-jobs-within-matrices
as an update for this PR; build run well... there is a revert in the claim contribution test, but test doesn't exit with exit code 1...
this call revert:
address contributorAccount = getContributorAddressById(c.contributorId);When I try to call any function in the Contribution app that call another app function, it revert.
like
getContributorIdByAddress()Am I missing something in the tests ?
Closing due to inactivity. Please feel free to re-open.
Closing due to inactivity. Please feel free to re-open.
Pull request closed