WIP: Contribution contracts tests #159
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "tests/contracts-contribution"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 oneit
block.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 DAO
let receipt = await dao.newAppInstance(
getBlockNumber
should 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 DAO
let 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 DAO
let 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 DAO
let 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:proposal
This 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:proposal
yeah true, I changed that also to
It is the same also, but
> /dev/null &
to not show the output and usingTASK
for 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:proposal
I 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 test
and nothing else, in my opinion.@ -18,0 +22,4 @@
- TASK=test:contributor
- TASK=test:contribution
- TASK=test:proposal
What 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:proposal
Oh, 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