Open elenadimitrova opened 4 years ago
Thank you for your issue. We will investigate the problem. I am going to keep you updated.
@elenadimitrova I cloned the repo and reproduced all the errors that you have described.
The issue with the Maximum call stack size exceeded
is coming from storing more than 1024 items in the stack. I am going to make deeper research and then I will try to propose you a workaround.
The issue with testing only the base
folder is that we are creating coverage-artifacts (compiling) only the contracts from that folder, but we are trying to run all the tests (which are related to other contracts as well).
How the coverage is working - we are compiling all the contracts two times (ones with solc compiler and once with 0x sol-compiler). Then we are using necessary parts from the compiled contracts (with 0x sol-compiler) to run coverage.
You are receiving the messages Unable to find matching bytecode for contract creation....etc...etc, please check your artifacts. Ignoring...
because there aren't compiled contracts in coverage-artifacts
folder, but there are transactions which are coming from contract addresses and the coverage cannot find them.
Could we run test file for only those contracts in the base
folder or test file for any random contract from your contracts ?
storing more than 1024 items in the stack
Is this an etherlime
issue or are you talking about the tests in the argent repo?
Also I don't understand your question at the end. Do you mean if we can pick the tests which use just the compiled contracts for coverage?
Right now, we are currently working on implementing solidity-coverage library in etherlime. (Expecting release is in the next week).
Thanks. I was going to ask about using solidity-coverage
which has recently been modularised better for this sort of integration but you beat me to it. It's great to know you're looking to integrate it.
On the second question, it would be rather difficult to incise tests that just run on a subset of contracts, plus I do need it running on the entire contracts folder not just the base
one I picked for testing. I am okay to hold off until you have a solidity-coverage
version to test with. Happy to test that when available.
@ochikov Hi, I help maintain solidity-coverage. If you run into any difficulties with the API (or have suggestions about how to improve it for your case) please just lmk.
Hey @cgewecke, how are you ? I have implemented the solidity-coverage
library in a separate development branch. I used argent repo to test it, but there is a problem compiling the instrumented
contracts. If I compile the raw contracts, they are compiling successfully. Once I instrument
them with solidity-coverage
, the following error occurs:
Any help with the issiue ?
Thanks.
@ochikov I'm not sure exactly what's going on there yet but I was able to get compilation to succeed using one of the existing plugin implementations if I set .solcover.js
like this:
module.exports = {
skipFiles: ["test"]
}
... which skips instrumentation for all the contracts in the contracts/test folder. Did you build in the ability to use a solcover config file? All you really have to do is load it and pass it to the API constructor. And then sort of follow the API examples for getting it to filter the sources into skipped
and targets
which both get written to .coverage_contracts
before compilation.
I think the problem is that there are non-solidity files in the contracts folder getting passed to the compiler. Uniswap JSONs at https://github.com/argentlabs/argent-contracts/tree/develop/contracts/test/uniswap
[EDIT - Actually those are getting filtered out correctly by assembleFiles
... I will have to experiment a bit more.]
@elenadimitrova do you need coverage on the contracts in the test
folder?
For the purposes of getting solidity-coverage
working with etherlime
we don't need the test
contracts covered for now @cgewecke . @ochikov you can even use a simpler project for testing if you prefer, it doesn't have to be the argent contracts base.
@elenadimitrova I've already implemented it and test it with simplе projects. It is perfectly working. I just wanted to test it with your repo, because it is quite complex. I am going to try the @cgewecke approach.
Investigated a bit more: suspect the problem is the number & size of the contracts in the Argent repo. Compilation succeeds even if you skip a subset of the test
contracts, (e.g. test/maker
, or test/compound
). Did not find a specific contract which is problematic.
RE: size, by way of comparison with another large project
The coverage tool almost doubles that by injecting additional statements to track line execution.
The size of the compiler outputs for Argent,(json-stringified and written to file) are:
SolcJS might have an upper bound on how much data it can process in one go.
@ochikov is there a way to configure coverage to exclude the test folder?
@elenadimitrova I have released a new etherlime version.
@ochikov thanks, I'm testing now. Facing some issues which I'll log separately.
Also, are you accepting a .solcover.js file for configuration?
The following are errors when trying to run coverage against the argent repo
etherlime coverage
producesPicking a small subfolder with just a couple of base contracts and running
etherlime coverage --runs=200 --workingDirectory=./contracts/base
compiles and starts to run tests successfully but has numerous of the following messagesfollowed by another stack depth error towards the end of the test run