-
Notifications
You must be signed in to change notification settings - Fork 269
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
Support for multiple truffle configs compilation #559
Comments
That's definitely a bug. For the other cases, do things work if you pass the config to coverage the way you would to compile?
|
If we pass a single config as a time to coverage it fails to find artifacts from other compilations it depends on. For example running
produces
|
Yes, I see, that makes sense. Will add an option that lets you configure the location of the temp contracts correctly. (It might be a few days before I publish these fixes (maybe the weekend) because I also need to get #548 out in the next release.) |
@elenadimitrova Apologies for the delay here. Believe Unfortunately, the issue with glob magic in the |
Thanks @cgewecke . Trying 0.7.12 I am still not seeing compilation recognising the different truffle configs e.g.:
This is if I purely run
To be clear on the requirements here, compared to |
Is it that you usually run multiple compilations before the test run and the artifacts accumulate in the truffle compile --config truffle-config-a.js
truffle compile --config truffle-config-b.js
...
truffle test --config truffle-config-test.js If so, you can emulate this by adding the truffle compile --config truffle-config-a.js
truffle compile --config truffle-config-b.js
...
# This will deposit coverage artifacts in the `build` folder instead of a temporary staging folder.
# Coverage will automatically delete the `build` folder when it completes
truffle run coverage --temp build --config truffle-config-test.js [EDIT] - if this doesn't work, will look directly at argent tomorrow. |
Yes. We run 9 compile commands which accumulate artifacts in the
Trying this with
If you do look at the argent repo, please use the |
Ah ok! Sorry, I've been very slow to understand what's happening here 🙂 . I think your coverage will need to be generated using a custom script that looks similar to the plugin code here but runs a loop which processes each config for instrumentation and compilation. Other projects do this as well - for example dydx generates their coverage with a script because they use jest instead of mocha. You would still have solidity-coverage as a dep but consume it as an api rather than through the generic truffle plugin. Will take a look at argent today and see if this can be done +/- simply. |
Thanks for the PR @cgewecke this sorted the compilation pipeline issue so closing this. |
@cgewecke any clues as to why coverage is reported differently for
vs a run with
|
until we figure out what is causing the result discrepancies sc-forks/solidity-coverage#559 (comment)
Oh! Ok, will take a look. |
When running coverage against a repo with a number of different truffle configs (we have nine argentlabs/argent-contracts#146) and a custom compilation setup, solidity-coverage fails to compile correctly as it tries to compile the entire
contracts
folder assuming all contracts inside are compiled with the roottruffle-config.js
.This may not always be the case and even though I can probably preemptively compile the project in the
onServerReady
hook, the compilation will still be triggered after that and it will always fail. I'm open to suggestions as to what can work best.I also have a problem with the root
truffle-config.js
configuration forcontracts_directory: "contracts/*.sol"
which solidity-coverage translates wrongly into:ls: no such file or directory: /argent-contracts/contracts/*.sol/**/*.sol
The text was updated successfully, but these errors were encountered: