brownie icon indicating copy to clipboard operation
brownie copied to clipboard

Coverage information stopped displaying after 100% coverage

Open spaceh3ad opened this issue 3 years ago • 1 comments

Environment information

  • brownie Version: 1.17.0
  • ganache-cli Version: 6.12.2
  • solc Version: x.x.x
  • Python Version: 3.9.5
  • OS: linux

What was wrong?

So i have 2 contracts in my dir one is a ERC20 and second one is a marketplace. I was testing converage of my test and reached 100% and afrter that I don't see information about contract: Marketplace I only see coverage info about ERC20 token, which I am not interested in, because it is used only for testing ERC20 standard.

  • brownie test -C

What I got previously:

====================================================================================== Coverage ======================================================================================

  contract: Market - 100.0%
    Market.arbitrage - 100.0%
    Market.buyItemWithEth - 100.0%
    Market.buyItemWithToken - 100.0%
    Market.confirmRecive - 100.0%
    Market.resolveOrder - 100.0%

  contract: TToken - 62.6%
    ERC20._approve - 75.0%
    ERC20._transfer - 75.0%
    ERC20.transferFrom - 75.0%
    ERC20.decreaseAllowance - 0.0%

Coverage report saved at /home/josh/Code/Blockchain_Dev/Brownie/Nextrope_Task/reports/coverage.json
View the report using the Brownie GUI
=====================================================

vs what i get now:

====================================================================================== Coverage =====================================================================================$

  contract: TToken - 62.6%
    ERC20._approve - 75.0%
    ERC20._transfer - 75.0%
    ERC20.transferFrom - 75.0%
    ERC20.decreaseAllowance - 0.0%

Coverage report saved at /home/josh/Code/Blockchain_Dev/Brownie/Nextrope_Task/reports/coverage.json
View the report using the Brownie GUI

How can it be fixed?

I used Ownable before for handling the ownership but changed that to assign the owner in consturctor and after that it became missing. If I switch back to inheriting from Ownable it displays again. I have no idea what's going on.

spaceh3ad avatar Dec 07 '21 00:12 spaceh3ad

I'm seeing same problems. See https://github.com/ActorForth/VyperDemoContracts/issues/1

Not having working code coverage is making it difficult to keep using Brownie.

scherrey avatar Mar 31 '22 08:03 scherrey