-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Resolution for duplicate test/contract names affecting forge test output #392
Comments
I suspect this is happening due to the |
Looks like the core issue here, like @gakonst pointed out, is that
so duplicate names as keys are being discarded. In dapptools they're fully qualified:
An easy fix would be to replace It also might make sense to change it upstream here since the current naming convention discards info. @gakonst / @mattsse how do you feel about this being changed upstream? Not sure if breaking changes will be an issue here. |
Here's the output from the example project if any clarity is needed: dapptools:
forge:
|
@mattsse what do you think about changing ethers-solc to return names that are more in line with dapptools? Or, possibly keeping things as they are but storing / exposing the additional info (path, anything else that makes sense) so it can be used downstream? Happy to do it |
@lattejed definitely, can you open an issue on ethers-rs with a rational/proposal. there are other things we should think about when it comes to naming of the artifacts: preventing artifact collisions entirely for example this is likely not a big deal if C is a library import, but could as well be another source contract. we also would run in to a collision if we have file:ContractName duplicates
|
Sounds good @mattsse I'll do that. I caught the artifact discussion elsewhere, I'll take a look including that as well. |
Opened an issue here for discussion gakonst/ethers-rs#791 |
Upstream PR changes output for forge to:
PR still WIP |
Demo repo: https://github.com/stevennevins/demo_behavior
Dapptools seems to handle if there are harness contracts with duplicate names and *.t.sol files with duplicate test case names, but forge will only display the result of the first case of these duplicates unless verbosity is increased. I've included a demo repo to show the behavior difference between dapptools and forge.
The text was updated successfully, but these errors were encountered: